Fix a regression where G/R/S stayed active after switching from Pen or Shape tool (#3166)

* Fix: cancel active G/R/S transform when switching from Pen or Shape tool

* Fix typo

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0SlowPoke0 2025-09-12 04:29:19 +05:30 committed by GitHub
parent 50f06c886f
commit 75ad8d4abd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -139,7 +139,10 @@ impl MessageHandler<ToolMessage, ToolMessageContext<'_>> for ToolMessageHandler
}
}
if matches!(old_tool, ToolType::Path | ToolType::Select) {
// If a G/R/S transform is active while using Path, Select, Pen, or Shape,
// and the user switches to a different tool, cancel the current transform
// operation to avoid leaving it in an inconsistent state
if matches!(old_tool, ToolType::Path | ToolType::Select | ToolType::Pen | ToolType::Shape) {
responses.add(TransformLayerMessage::CancelTransformOperation);
}
};