scratchfoundation / scratch-paint

Paint editor for Scratch 3.0
https://llk.github.io/scratch-paint/
BSD 3-Clause "New" or "Revised" License
175 stars 226 forks source link

New paint editor: initial zoom is not centered #1058

Open lisa-wolfgang opened 4 years ago

lisa-wolfgang commented 4 years ago

Expected Behavior

When zooming in, the center crosshair is in the center of the screen. When zooming back out, the center crosshair is still in the center of the screen.

Actual Behavior

When zooming in on costumes with more than one component that aren't centered, you can see that the view is not centered on the absolute costume center, but the relative costume center: https://u.cubeupload.com/lisa_wolfgang/ZoomBug1.png

Zooming back out isn't centered either: https://u.cubeupload.com/lisa_wolfgang/ZoomBug2.png

The = button does nothing to help. Only scrolling when zoomed out at the maximum level centers the view.

Steps to Reproduce

  1. Create a new costume
  2. Place two shapes (rectangle or ellipse would probably be easiest) at a corner of the editor or where it is not centered

Operating System and Browser

Windows NT 10.0, Firefox 76.0

adroitwhiz commented 4 years ago

I believe it's an intentional design decision to start out centered around the costume's contents. Remaining off-center even when zoomed out sounds like a bug, however.

I can't reproduce that part--whenever I zoom out, the canvas re-centers itself properly. Mind sharing the costume that's causing the issue for you? (GitHub lets you upload .svgs if you change the file extension to .txt)

lisa-wolfgang commented 4 years ago

Thumbnail.txt

adroitwhiz commented 4 years ago

:+1: I can reproduce this-- I had to drag it so the rectangular thumbnail was in the center of the editor, but after doing so, it loads in off-center. Here's a demo project.

lisa-wolfgang commented 4 years ago

It seems that the relative centering (and therefore the bug) only occurs when there are multiple objects in the costume. I'll update the initial post.

fsih commented 4 years ago

Let's discuss what the expected behavior should be