pencil2d / pencil

Pencil2D is an easy, intuitive tool to make 2D hand-drawn animations. Pencil2D is open source and cross-platform.
http://pencil2d.org
GNU General Public License v2.0
1.47k stars 273 forks source link

Camera Overlays get distorted scaling when zooming the camera #1637

Closed Jose-Moreno closed 2 years ago

Jose-Moreno commented 3 years ago

Issue Summary

Ever since v0.6.5 as well as in the current nightly from May 11th 2021, zooming in with the camera will affect some of the camera overlays scaling relative to the camera itself. The most affected ones are: the Show Field Center Overlay and the Show Safe Areas Overlay.

This seems to occur due to how the view manager and the camera manager seem to share behaviour via the hand tool and view transforms, so I'm hopeful that #1587 will address the root cause of this problem due to the coupling, so we can fix this soon after merging the PR.

Expected Results

Camera transforms should only affect the "contents" of the canvas and not the scaling of the overlays in a direct proportional relationship. These overlays should keep their scaling relative to the camera as seen from the canvas view, so I supposed it's an inverse proportional relationship considering that when we zoom in the camera layer, the drawing view shows the camera as becoming smaller, and if we zoom out the camera field will look bigger instead.

In that sense If I scale / zoom my camera by 200% but my view is at 100%, the safe area text should not zoom in with the camera but rather stay proportional to the scaling factor of the canvas view and become 50% smaller.

Video or Image Reference

Canvas View Zoom Factor: 100% | Camera Zoom Factor: 400% image

Steps to reproduce

  1. Open Pencil2D
  2. Turn the display panel buttons for Center Field and Safe Areas. Notice their size at a default zoom factor
  3. Select the camera layer
  4. Use the UP/DOWN arrow keys to control the scaling in even increments and increase the zoom at least up to 400% to notice a difference.
  5. Select the bitmap layer back. Notice the camera frame has become smaller but the relevant overlays have become larger.

What would be expected is that the overlays would become smaller since the camera frame looks smaller in the canvas view "mode"

System Information

Nightly Build May 11 2021

commit: 7ba6e71f81eb6337af4cb378284b7e72ea160f79 date: 2021-05-11_07:39:53

Operating System: Windows 10 Version 2009 (202H) CPU Architecture: x86_64 Qt Version: 5.15.2

MrStevns commented 3 years ago

Will be fixed via #1587