From a7419c78131a3e6309923a6de6aae0a83c05e4b8 Mon Sep 17 00:00:00 2001 From: Gaspar Capello Date: Wed, 30 Dec 2020 16:35:36 -0300 Subject: [PATCH] Fix pen pressure size + symmetry This fix improves the symmetry drawing when symmetry and the pen pressure size are on. --- src/app/tools/symmetries.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/app/tools/symmetries.cpp b/src/app/tools/symmetries.cpp index edbfb7dc5..78557c2f1 100644 --- a/src/app/tools/symmetries.cpp +++ b/src/app/tools/symmetries.cpp @@ -38,8 +38,13 @@ void HorizontalSymmetry::generateStrokes(const Stroke& mainStroke, Strokes& stro strokes.push_back(mainStroke); Stroke stroke2; + const bool isDynamic = loop->getDynamics().isDynamic(); for (const auto& pt : mainStroke) { Stroke::Pt pt2 = pt; + if (isDynamic) { + brushSize = pt2.size; + brushCenter = (brushSize - brushSize % 2) / 2; + } pt2.x = m_x - ((pt.x-brushCenter) - m_x + 1) - (brushSize - brushCenter - 1); stroke2.addPoint(pt2); } @@ -63,8 +68,13 @@ void VerticalSymmetry::generateStrokes(const Stroke& mainStroke, Strokes& stroke strokes.push_back(mainStroke); Stroke stroke2; + const bool isDynamic = loop->getDynamics().isDynamic(); for (const auto& pt : mainStroke) { Stroke::Pt pt2 = pt; + if (isDynamic) { + brushSize = pt2.size; + brushCenter = (brushSize - brushSize % 2) / 2; + } pt2.y = m_y - ((pt.y-brushCenter) - m_y + 1) - (brushSize - brushCenter - 1); stroke2.addPoint(pt2); }