Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

handles to stretch the shape #15

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

vera0005
Copy link

No description provided.

@rsimon
Copy link
Member

rsimon commented Nov 19, 2021

Thanks for this. I think the PR might be missing some code parts, however. At the moment, it doesn't do anything. If I understand correctly, the code is for moving stretch handles that will resize the shape. However, there are currently no stretch handles, meaning that code will never get executed. Can you check, or describe what you intend to do?

@vera0005
Copy link
Author

vera0005 commented Nov 19, 2021

Woops... I forgot to change a line in the function getPoints. I will commit a change soon. The correct line should be const pointList = shape.querySelector('.a9s-inner').getAttribute('d').split('L');

My purpose in this pull request is to add many stretch handles to the boundary, so that we can adjust a local part of the boundary by dragging a handle. This feature is useful if we want to correct/refine a part of the boundary.

I also plan to redraw freely a part of the boundary. After connecting the end points, the old part would disappear. Is that a good idea?

@rsimon
Copy link
Member

rsimon commented Nov 22, 2021

Thanks for the update! Redrawing freely sounds like an interesting use case & would be a good addition I think.

Just one thing: at the moment, its no longer possible to move the shape as a whole. There's an exception when getPoints is called with the inner shape. Your modified getPoints queries again for .a9s-inner which doesn't exist any more. That's part is easy to fix. But more importantly, when the whole shape is dragged, the handles don't move along - see screenshot below.

image

I think with just a bit of refactoring, that's probably easy to address without additional code. Would you be ok looking into this? Editable freehand would be an excellent addition - thanks for the work so far!

@vera0005
Copy link
Author

Thanks, Rainer. You are right. Now the freehand shape is not moveable as a whole. A regression. How to fix that? Without querySelector('.a9s-inner'), the function getPoints does not work.

I will look into the "handles don't move along" problem. In the mean time, I will keep working on the editable freehand drawing tool. Hopefully I can get some preliminary results in a few days.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants