From a59b17d6cf1c6c0d92a90394fbc10a90470c4264 Mon Sep 17 00:00:00 2001 From: rolandlo Date: Wed, 26 Apr 2023 13:25:17 +0200 Subject: [PATCH] Fix setting line style for selection --- src/core/control/Control.cpp | 3 +-- src/core/control/ToolHandler.cpp | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/control/Control.cpp b/src/core/control/Control.cpp index 1030ffaabb72..6160c131169e 100644 --- a/src/core/control/Control.cpp +++ b/src/core/control/Control.cpp @@ -3152,9 +3152,8 @@ void Control::setLineStyle(const string& style) { if (sel) { undoRedo->addUndoAction(sel->setLineStyle(stl)); - } else { - this->toolHandler->setLineStyle(stl); } + this->toolHandler->setLineStyle(stl); } void Control::setToolSize(ToolSize size) { diff --git a/src/core/control/ToolHandler.cpp b/src/core/control/ToolHandler.cpp index c1e82f0c7d26..e3bd4367414f 100644 --- a/src/core/control/ToolHandler.cpp +++ b/src/core/control/ToolHandler.cpp @@ -319,7 +319,8 @@ void ToolHandler::setButtonSize(ToolSize size, Button button) { } void ToolHandler::setLineStyle(const LineStyle& style) { - this->tools[TOOL_PEN - TOOL_PEN]->setLineStyle(style); + Tool* tool = this->toolbarSelectedTool; + tool->setLineStyle(style); this->stateChangeListener->toolLineStyleChanged(); }