Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to handle position of Polygon over the image ? #218

Open
florian583 opened this issue Aug 12, 2021 · 2 comments
Open

How to handle position of Polygon over the image ? #218

florian583 opened this issue Aug 12, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@florian583
Copy link

Hi,

I'm currently trying to use this module for adding polygons overlay on image.
I'm having coordinates of the polygons in this format :

{'0004-0053': {'type': 'polygon', 'x': [633, 430, 426, 426, 430, 433, 434, 440, 441, 444, 444, 446, 449, 450, 457, 458, 463, 465, 475, 478, 503, 513, 542, 546, 570, 577, 579, 582, 583, 585, 591, 593, 600, 601, 604, 605, 614, 618, 625, 629, 633], 'y': [0, -1, 0, 8, 19, 21, 26, 33, 47, 54, 58, 59, 67, 76, 85, 89, 93, 101, 106, 104, 104, 100, 103, 101, 99, 91, 85, 83, 75, 71, 66, 57, 51, 41, 39, 35, 27, 16, 9, 8, 4], 'n': 41, 'width': 1, 'name': '0004-0053', 'position': 0}}

So I can draw the polygon properly it seems using the JSON "upload" function, but I cannot get it to adjust the position properly over the image ? Those X and Y coordinates should be enough ?

CleanShot 2021-08-13-IDnSTUkP@2x

Willing to remunerate/pay for any help on this !
Thank you very much

@florian583 florian583 added the bug Something isn't working label Aug 12, 2021
@AndreasBurbach
Copy link

If you want to change it on your own: the possibility to move the points of a polygon is shown here
http://fabricjs.com/custom-controls-polygon

the editor just needs some modification

@AndreasBurbach
Copy link

Created a fork of this project, but first of all i will only create a repo for the image editor https://github.com/AndreasBurbach/react-image-design-editor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants