diff --git a/ChangeLog.md b/ChangeLog.md index ea550e159..6674a67b6 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -18,6 +18,7 @@ + Avoid updating width/feather sliders for tools that don’t use them [cce3107](https://github.com/pencil2d/pencil/commit/cce31079c871fcc04e957c44d5c6e65990f635f1) + Fix fill misbehaving when drawing was partly outside border [#1865](https://github.com/pencil2d/pencil/pull/1865) + Fix clearing selection with the delete shortcut [#1892](https://github.com/pencil2d/pencil/pull/1892) ++ Fix camera handles not being draggable at 90 deg [#1897](https://github.com/pencil2d/pencil/issues/1897) ## Pencil2D v0.7.0 - 12 July 2024 diff --git a/core_lib/src/interface/editor.cpp b/core_lib/src/interface/editor.cpp index d5aabb9ac..8c3ceb0de 100644 --- a/core_lib/src/interface/editor.cpp +++ b/core_lib/src/interface/editor.cpp @@ -436,7 +436,7 @@ LayerVisibility Editor::layerVisibility() qreal Editor::viewScaleInversed() { - return view()->getViewScaleInverse(); + return view()->getScaleInversed(); } void Editor::increaseLayerVisibilityIndex() diff --git a/core_lib/src/interface/scribblearea.cpp b/core_lib/src/interface/scribblearea.cpp index 26046470e..64492b89a 100644 --- a/core_lib/src/interface/scribblearea.cpp +++ b/core_lib/src/interface/scribblearea.cpp @@ -1080,7 +1080,7 @@ void ScribbleArea::prepCameraPainter(int frame) mEditor->playback()->isPlaying(), mLayerVisibility, mPrefs->getFloat(SETTING::LAYER_VISIBILITY_THRESHOLD), - mEditor->view()->getViewScaleInverse()); + mEditor->view()->getScaleInversed()); OnionSkinPainterOptions onionSkinOptions; onionSkinOptions.enabledWhilePlaying = mPrefs->getInt(SETTING::ONION_WHILE_PLAYBACK); diff --git a/core_lib/src/managers/viewmanager.cpp b/core_lib/src/managers/viewmanager.cpp index 9b85848ea..d4b7834e5 100644 --- a/core_lib/src/managers/viewmanager.cpp +++ b/core_lib/src/managers/viewmanager.cpp @@ -108,9 +108,9 @@ QTransform ViewManager::getViewInverse() const return mViewCanvasInverse; } -qreal ViewManager::getViewScaleInverse() const +qreal ViewManager::getScaleInversed() const { - return mViewCanvasInverse.m11(); + return 1. / mScaling; } void ViewManager::updateViewTransforms() diff --git a/core_lib/src/managers/viewmanager.h b/core_lib/src/managers/viewmanager.h index 1c0009c4d..7b7b8ff8e 100644 --- a/core_lib/src/managers/viewmanager.h +++ b/core_lib/src/managers/viewmanager.h @@ -36,7 +36,10 @@ class ViewManager : public BaseManager QTransform getView() const; QTransform getViewInverse() const; - qreal getViewScaleInverse() const; + + /** @return The inverted scale value */ + qreal getScaleInversed() const; + void resetView(); QPointF mapCanvasToScreen(QPointF p) const; diff --git a/core_lib/src/tool/cameratool.cpp b/core_lib/src/tool/cameratool.cpp index e0d1045b8..5b5a26823 100644 --- a/core_lib/src/tool/cameratool.cpp +++ b/core_lib/src/tool/cameratool.cpp @@ -81,7 +81,7 @@ void CameraTool::updateUIAssists(const Layer* layer) Camera* cam = camLayer->getLastCameraAtFrame(mEditor->currentFrame(), 0); if (cam) { - mRotationHandlePoint = localRotationHandlePoint(cameraRect.topLeft(), localCamT, cam->scaling(), mEditor->view()->getViewScaleInverse()); + mRotationHandlePoint = localRotationHandlePoint(cameraRect.topLeft(), localCamT, cam->scaling(), mEditor->view()->getScaleInversed()); } }