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

additional tools #1644

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

adamcanray
Copy link

hi,


continuing my question here #1643, i am about to add some tools that fit my current project. i was just thinking maybe there's other who need this, so i decided to open a pull request.

draw options:

  • select: sometimes we want to only select a drawing object to edit the size or position without drawing any shapes. i don't know if this feature already exists or not, but i'll use it for my current project. also, i notice the draw options are all for shapes, and select is not a shape at all. the problem is that i will not be able to select drawing objects if i am not in the drawing layer.

tools:

  • zoom-in: zoom-in on mousedown by adding a 0.1 scale step.
  • zoom-out: zoom-out on mousedown by adding a -0.1 scale step.
  • pan: pan on mousemove or touchmove.

note:

  • zoom-in, zoom-out, and pan are reusing the existing code zoomPan. i copy it, then edit it a little.
  • for zoom-in and zoom-out, the wheel is still active, so it can either do zoom-in or zoom-out with a click or touch, or zoom-in or zoom-out on the wheel or scroll.
  • i only test this on chrome, not sure this is work well on other browser.

thanks.

@adamcanray adamcanray changed the title Develop addition tools additional tools Mar 26, 2024
@ivmartel
Copy link
Owner

ivmartel commented Apr 3, 2024

Hi, thanks for all that. I just wanted to mention that tools can also be loaded directly in an app options, it does not have to live with the main code. It can live with your code and when you instantiate the dwv app, you pass an instance of the tool.
I'll create an example.

@adamcanray
Copy link
Author

ah, it would be great if that was possible. looking forward to that example. thank you for replying, @ivmartel.

@ivmartel
Copy link
Owner

ivmartel commented Apr 3, 2024

Here is a simple demo gist: https://gist.github.com/ivmartel/8bae193e47c0d1e7a29e1dbc43edb4f5
(which does not work on Firefox... not sure why...)

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

Successfully merging this pull request may close these issues.

None yet

2 participants