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

Dragging ruler while zoomed in leads to uncontrolled panning #367

Closed
KatieWoe opened this issue Mar 11, 2022 · 8 comments
Closed

Dragging ruler while zoomed in leads to uncontrolled panning #367

KatieWoe opened this issue Mar 11, 2022 · 8 comments

Comments

@KatieWoe
Copy link
Contributor

Test device
Dell
Operating System
Win 11
Browser
Chrome
Problem description
Found in master on 3/11/22. First discovered by @kathy-phet.
When you drag the ruler while the sim is zoomed in, it can be very hard to place it in an intended position. Panning occurs any time you move the mouse, and also occurs the second you pick up the ruler. This makes it hard to place the ruler where you want it.

Steps to reproduce

  1. Go to the first screen
  2. Drag out the horizontal ruler
  3. Zoom the screen in enough that both edges are off the screen
  4. Try to move the ruler. Particularly hard if dragging one side.

Visuals
zoomedinruler

Troubleshooting information:

!!!!! DO NOT EDIT !!!!!
Name: Geometric Optics
URL: https://bayes.colorado.edu/dev/phettest/geometric-optics/geometric-optics_en.html?ea&brand=phet
Version: 1.1.0-dev.36 (unbuilt)
Features missing: applicationcache, applicationcache, touch
Flags: pixelRatioScaling
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36
Language: en-US
Window: 1280x649
Pixel Ratio: 1.5/1
WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium)
GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)
Vendor: WebKit (WebKit WebGL)
Vertex: attribs: 16 varying: 30 uniform: 4096
Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32)
Max viewport: 32767x32767
OES_texture_float: true
Dependencies JSON: {}

@KatieWoe KatieWoe added the type:bug Something isn't working label Mar 11, 2022
@pixelzoom
Copy link
Contributor

pixelzoom commented Mar 11, 2022

I don't see how this can be addressed -- or really why it needs to be addressed. You need to be able to see the full ruler to place it. If you can't see the full ruler, you should zoom out.

@arouinfar @jessegreenberg thought?

@pixelzoom pixelzoom assigned arouinfar and unassigned pixelzoom Mar 11, 2022
@pixelzoom pixelzoom added design:a11y and removed type:bug Something isn't working labels Mar 11, 2022
@arouinfar
Copy link
Contributor

This behavior is not unique to Geometric Optics, the same happens in master with the ruler in Gravity Force Lab. This seems like a natural consequence of the size of the ruler exceeding the zoom bounds.

You need to be able to see the full ruler to place it. If you can't see the full ruler, you should zoom out.

Agreed @pixelzoom. It doesn't seem like anything that needs to be addressed, but I'll defer to @jessegreenberg's judgment.

@arouinfar arouinfar removed their assignment Mar 11, 2022
@jessegreenberg
Copy link
Contributor

I agree that one needs to zoom out to place it but dragging it does feel out of control. As soon as you tap on the ruler the whole screen pans so that the left most side of the ruler is in view and it is disorienting. Taking a look.

@jessegreenberg
Copy link
Contributor

I propose that we don't pan objects that are larger than the available screen size during drag. When the object can be fully contained by the available screen space we pan to keep it in view. Otherwise you need to drop the object and drag the screen to understand where you are going.

Example:

rts

@kathy-phet or @KatieWoe can you try this on master and comment if this is more expected behavior and an expectable rule for the pan/zoom feature generally?

@pixelzoom
Copy link
Contributor

pixelzoom commented Mar 16, 2022

Seems reasonable to me. Adding @arouinfar to the "try on master" assignment.

@KatieWoe
Copy link
Contributor Author

I think it behaves much better now.

@arouinfar
Copy link
Contributor

Thanks @jessegreenberg, the behavior in master looks much better to me.

comment if this is more expected behavior and an expectable rule for the pan/zoom feature generally?

This seems like something we would want to generalize to any draggable object. Not sure if it has already been generalized, or if it needs a separate issue to track, so back to @jessegreenberg.

@jessegreenberg
Copy link
Contributor

OK sounds good. Yes, this is being done generally in phetsims/scenery#1381. Ill consider that a sign-off for this change and finish up over there.

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

No branches or pull requests

5 participants