From 55663e2c0ab8f7d4b64a2b3d4d671d7649c20ae3 Mon Sep 17 00:00:00 2001 From: Benjamin Hennion Date: Thu, 9 Dec 2021 17:22:52 +0100 Subject: [PATCH] Fix #3651 - remove pressure value on Highlighter strokes first point --- src/control/tools/StrokeHandler.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/control/tools/StrokeHandler.cpp b/src/control/tools/StrokeHandler.cpp index fd54d46d3952..22e82bdbaeb7 100644 --- a/src/control/tools/StrokeHandler.cpp +++ b/src/control/tools/StrokeHandler.cpp @@ -369,9 +369,14 @@ void StrokeHandler::onButtonPressEvent(const PositionInputData& pos) { this->buttonDownPoint.x = pos.x / zoom; this->buttonDownPoint.y = pos.y / zoom; - createStroke(Point(this->buttonDownPoint.x, this->buttonDownPoint.y, pos.pressure)); + this->hasPressure = this->xournal->getControl()->getToolHandler()->getToolType() == TOOL_PEN && + pos.pressure != Point::NO_PRESSURE; - this->hasPressure = this->stroke->getToolType() == STROKE_TOOL_PEN && pos.pressure != Point::NO_PRESSURE; + if (this->hasPressure) { + createStroke(Point(this->buttonDownPoint.x, this->buttonDownPoint.y, pos.pressure)); + } else { + createStroke(Point(this->buttonDownPoint.x, this->buttonDownPoint.y)); + } stabilizer->initialize(this, zoom, pos);