godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.14k stars 20.21k forks source link

Panning/scrolling stops working in editor on high zoom | Editor view limiter issue #66362

Open Arrekin opened 1 year ago

Arrekin commented 1 year ago

Godot version

v4.0.beta1.official [20d667284]

System information

Windows 10

Issue description

When adding a bigger object (in my case 8k image) into the editor and zooming out, I lose the ability to navigate(pan/zoom) freely in the editor with the middle mouse button. I can move up and to the left, but not down or right. Once I reach the max top left position, the editor screen is locked(becomes unmovable).

https://user-images.githubusercontent.com/11314775/192106117-b36c5c40-84fb-48b6-bad9-f55ebe61b7b1.mp4

After playing a bit, I noticed all works well as long as there are scroll bars visible. Once I zoom out, so the entire scene is visible, the scroll bars disappear, and the problem starts. If I zoom in so the scroll bars are visible again, everything works again.

With Editor Setting -> Editor -> 2D -> Constrain Editor View disabled, the problem does not occur. There must be some problem with the auto-limiter. After I scaled down the picture and cloned it several times, placing each one more to the bottom and to the right, the issue was the same, so it's not about the sprite size but something more general.

As you can see on the attached video, I've been able to pan a lot to the left and up, so probably that's the issue. Detection is skewed, stealing area from right and bottom, allowing panning more into empty left and top.

Steps to reproduce

  1. Make sure Editor Setting -> Editor -> 2D -> Constrain Editor View is ENABLED
  2. Place on the scene a large object(I had an 8k image), or alternatively a smaller object but put it as far in the right bottom quarter as you can.
  3. While still on 100% zoom confirm you can pan over the entire image
  4. zoom out until the scroll bars disappear (and a bit more just to be safe)
  5. Now you should not be able to pan to the right and to the bottom
  6. Pan to the left and up (you should be able to)
  7. Once you reach the most top left position, you should not be able to move at all anymore.

Minimal reproduction project

No response

Calinou commented 1 year ago

See https://github.com/godotengine/godot/pull/47628. I guess this is one more reason to remove constrained view :slightly_smiling_face: