You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We don't need to include these new tools in the Toolbar because @ChrisLowe-Takor doesn't use the Toolbar in his implementation. So we just need a new handle in a file here, called ScaleHandle.js:
And we should rename RotateHandle.js to RotateAndScaleHandle.js and preserve the original version there too. Then we can hook up our new handles like is done here:
Later we could make things less redundant by sharing some utility functions. But let's not worry about that now.
So to be clear, we'll end with three handles:
the original RotateHandle.js renamed to RotateAndScaleHandle.js
the new RotateHandle.js which ONLY rotates (as per the diff-modified version above)
the new ScaleHandle.js which ONLY scales (as per the diff-modified version above)
And matching code in /src/edit/DistortableImage.Edit.js to connect them all up.
The Toolbar code will probably need to be modified to link only to RotateAndScaleHandle
Finally, this will take some chasing around the codebase to ensure the new files are included in Grunt, and all references to RotateHandle are updated to RotateAndScaleHandle:
This is a bit more complex, and tests will have to be updated, but we can do this step by step and I'm happy to help out if anyone wants to take on this project!
The text was updated successfully, but these errors were encountered:
Projects described in #105 need separate tools for scale and rotate. We can copy out sections of the combined Scale/Rotate to make independent parts.
rotation/scale were split into separate actions in this diff from @ChrisLowe-Takor (Also see this line
Here is the full diff; it's not too complex: https://gist.github.com/jywarren/59f0cb0baec03bee99540ac2af2ecf70/revisions?diff=split#diff-d592453497ece2dffbf1a19cb06db126
There's new code for a "scale" handle here:
https://gist.github.com/jywarren/59f0cb0baec03bee99540ac2af2ecf70/revisions?diff=split#diff-d592453497ece2dffbf1a19cb06db126R308
We don't need to include these new tools in the Toolbar because @ChrisLowe-Takor doesn't use the Toolbar in his implementation. So we just need a new handle in a file here, called
ScaleHandle.js
:https://github.com/publiclab/Leaflet.DistortableImage/tree/master/src/edit
And we should rename
RotateHandle.js
toRotateAndScaleHandle.js
and preserve the original version there too. Then we can hook up our new handles like is done here:Leaflet.DistortableImage/src/edit/DistortableImage.Edit.js
Line 42 in dc9e64c
Later we could make things less redundant by sharing some utility functions. But let's not worry about that now.
So to be clear, we'll end with three handles:
RotateHandle.js
renamed toRotateAndScaleHandle.js
RotateHandle.js
which ONLY rotates (as per the diff-modified version above)ScaleHandle.js
which ONLY scales (as per the diff-modified version above)And matching code in
/src/edit/DistortableImage.Edit.js
to connect them all up.The Toolbar code will probably need to be modified to link only to
RotateAndScaleHandle
Finally, this will take some chasing around the codebase to ensure the new files are included in Grunt, and all references to
RotateHandle
are updated toRotateAndScaleHandle
:https://github.com/publiclab/Leaflet.DistortableImage/search?q=rotate&unscoped_q=rotate
This is a bit more complex, and tests will have to be updated, but we can do this step by step and I'm happy to help out if anyone wants to take on this project!
The text was updated successfully, but these errors were encountered: