Skip to content

Commit

Permalink
Remove bogus check for setting same canvas model
Browse files Browse the repository at this point in the history
The canvas model is always different, because the previous one is
destroyed right before this function is called. If you got unlucky, the
new canvas model was allocated at the same memory address, causing this
check to pass incorrectly, causing some connections to not be made,
which in turn broke selections (and probably other, less noticeable
stuff.)
  • Loading branch information
askmeaboutlo0m committed Sep 9, 2023
1 parent 44eacde commit c5e4e2d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Unreleased Version 2.2.0-pre
* Feature: Kinetic scrolling. This lets you click/tap/touch scrollable stuff and fling it around instead of using the scroll bars or wheel. Configurable in the preferences. Thanks again Verdrusk.
* Fix: Make two-finger zoom and rotation not go completely crazy when the canvas is mirrored or flipped. Thanks BoyOnion for reporting.
* Fix: Don't crash when picking a brush preset on Android. Thanks to zetalambo and VeeBeeArt for reporting.
* Fix: Selections finally no longer sometimes disappear when transforming them. Thanks to Spuzzy, Xan and xxxx for reporting.

2023-08-26 Version 2.2.0-beta.7
* Fix: Make classic brushes not go brighter when smudging into transparency. Thanks to cada for reporting.
Expand Down
16 changes: 7 additions & 9 deletions src/libclient/tools/toolcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,13 @@ void ToolController::setStabilizerUseBrushSampleCount(bool stabilizerUseBrushSam

void ToolController::setModel(canvas::CanvasModel *model)
{
if(m_model != model) {
m_model = model;
connect(
m_model->aclState(), &canvas::AclState::featureAccessChanged, this,
&ToolController::onFeatureAccessChange);
connect(
m_model, &canvas::CanvasModel::selectionChanged, this,
&ToolController::onSelectionChange);
}
m_model = model;
connect(
m_model->aclState(), &canvas::AclState::featureAccessChanged, this,
&ToolController::onFeatureAccessChange);
connect(
m_model, &canvas::CanvasModel::selectionChanged, this,
&ToolController::onSelectionChange);
emit modelChanged(model);
}

Expand Down

0 comments on commit c5e4e2d

Please sign in to comment.