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

iss-1897 - Fix view rotation effects affects various view handles #1898

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion core_lib/src/interface/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ LayerVisibility Editor::layerVisibility()

qreal Editor::viewScaleInversed()
{
return view()->getViewScaleInverse();
return view()->getScaleInversed();
}

void Editor::increaseLayerVisibilityIndex()
Expand Down
2 changes: 1 addition & 1 deletion core_lib/src/interface/scribblearea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions core_lib/src/managers/viewmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 4 additions & 1 deletion core_lib/src/managers/viewmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion core_lib/src/tool/cameratool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

Expand Down
Loading