Polygon setCustomDrawHandler

WebViewer Version: 8.12.0

Do you have an issue with a specific file(s)? no
Can you reproduce using one of our samples or online demos? yes
Are you using the WebViewer server? no
Does the issue only happen on certain browsers? no
Is your issue related to a front-end framework? yes
Is your issue related to annotations? yes

Please give a brief summary of your issue:
Use setCustomDrawHandler to draw the polygon

Please describe your issue and provide steps to reproduce it:
Hello, Apryse team!

When create a new polygon, the first point’s box appears to connect it with the last point(image below)

When calling setCustomDrawHandler, the originalDraw is called inside the callback for original polygon drawing. In this case, when creating a polygon, the first point’s box doesn’t appear(image below).
Is it possible to add this box so that the first and last points of the polygon can be connected as in the usual approach?

Hello alc,

Currently, we don’t have the APIs to draw the drop area exposed, however, this is a great feature request. I have added this to our backlog to be reviewed by our product team!

I cant share the code for how it draws the drop area, but here’s an explanation of what happens:

  1. It takes in a canvas, point to draw it at, zoom level, and size
  2. Uses the points to calculate where to draw the box and what size to draw it at with the params
  3. Uses canvas context draw line commands with those coordinates

Best regards,
Tyler Gordon