Skip to content

Commit

Permalink
Fix stroke not being shown on a selection while drawing (#1807)
Browse files Browse the repository at this point in the history
* Fix stroke not being shown on a selection while drawing

* Fix transform not being applied when leaving a temporary tool

* Assert that selection using identity transform is implied while drawing

---------

Co-authored-by: Jakob Gahde <[email protected]>
  • Loading branch information
MrStevns and J5lx authored Jan 19, 2024
1 parent 3c9a7a4 commit 4eb1643
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core_lib/src/canvaspainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ void CanvasPainter::paintCurrentBitmapFrame(QPainter& painter, const QRect& blit
}

// We do not wish to draw selection transformations on anything but the current layer
if (isCurrentLayer && mRenderTransform) {
Q_ASSERT(!isDrawing || mSelectionTransform.isIdentity());
if (isCurrentLayer && mRenderTransform && !isDrawing) {
paintTransformedSelection(currentBitmapPainter, paintedImage, mSelection);
}

Expand Down
5 changes: 4 additions & 1 deletion core_lib/src/managers/toolmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,10 @@ void ToolManager::setTemporaryTool(ToolType eToolType)

void ToolManager::clearTemporaryTool()
{
mTemporaryTool = nullptr;
if (mTemporaryTool) {
mTemporaryTool->leavingThisTool();
mTemporaryTool = nullptr;
}
mTemporaryTriggerKeys = {};
mTemporaryTriggerModifiers = Qt::NoModifier;
mTemporaryTriggerMouseButtons = Qt::NoButton;
Expand Down

0 comments on commit 4eb1643

Please sign in to comment.