SketchUp / api-issue-tracker

Public issue tracker for the SketchUp and LayOut's APIs
https://developer.sketchup.com/
38 stars 10 forks source link

Option to disable Auto-Pan in Sketchup::Tool #370

Open Fredosixx opened 5 years ago

Fredosixx commented 5 years ago

Currently, all Ruby interactive tools (e.g. class Sketchup::Tool) have by default the AUTO-PAN feature enabled: when you move the mouse, with Left button down, across the edge of the viewport, the view starts panning.

This is also the behavior in almost all native Sketchup tools (Move, scale, ...), except the Select Tool.

I found NO way to disable it via the API.

Issue: this might be undesirable in some extensions when precisely the user selects an area on the viewport (say, like the Select tool), and the cursor gets close or across a viewport border. Then, what happens, is that the view starts to pan and the user has lost his original view camera, with no way to go back, except manually.

Furthermore, if you move the mouse across a viewport border with Left Button DOWN, but then RELEASE THE BUTTON while outside the viewport, the view pans indefinitely, until you click in the viewport.

Request: offer an option in the API to disable / enable / check Auto-pan.

Thanks

Fredo

DanRathbun commented 5 years ago

Does returning false from the onMouseMove and / or onMouseLeave callbacks have any effect ?

DanRathbun commented 5 years ago

... and if not, what would you prefer:

Fredosixx commented 5 years ago

I think the simpler is: autopan? and autopan= [true|false] methods.

I can actually detect the situation when it auto-pans. So onAutoPan(flags,x,y,view) would really just be an extra.

In most plugins, AutoPan makes sense and is not a problem. But in some cases, what you really want to do is to disable the feature.

Fredo

PS: I did not find a way to assign labels to this issue thread.

thomthom commented 5 years ago

PS: I did not find a way to assign labels to this issue thread.

That's my job. ;)