From 1fb5008e85ae4bf7a54c49861df1550b0ed5eea3 Mon Sep 17 00:00:00 2001 From: Matthias Kuehlewein Date: Thu, 13 Oct 2022 10:48:57 +0200 Subject: [PATCH] LineSymbol: Fix dashed line with mid symbols Dashed lines with mid symbols that are placed in the center of a dash are sometimes disturbed. This commit ensures that the dash is always drawn the same way, independent of whether mid symbols are present or not. Fixes #2064 --- src/core/symbols/line_symbol.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/core/symbols/line_symbol.cpp b/src/core/symbols/line_symbol.cpp index 36b62be6d..c39fc88fb 100644 --- a/src/core/symbols/line_symbol.cpp +++ b/src/core/symbols/line_symbol.cpp @@ -1,6 +1,6 @@ /* * Copyright 2012, 2013 Thomas Schöps - * Copyright 2012-2020 Kai Pastor + * Copyright 2012-2022 Kai Pastor * * This file is part of OpenOrienteering. * @@ -803,23 +803,19 @@ void LineSymbol::processContinuousLine( { auto mid_position = (split.clen + effective_end_length - mid_symbols_length) / 2; auto next_split = SplitPathCoord::at(mid_position, split); - path.copy(split, next_split, processed_flags, processed_coords); - split = next_split; auto orientation = qreal(0); - bool mid_symbol_rotatable = bool(mid_symbol) && mid_symbol->isRotatable(); + bool mid_symbol_rotatable = mid_symbol->isRotatable(); for (auto i = mid_symbols_per_spot; i > 0; --i) { if (mid_symbol_rotatable) - orientation = split.tangentVector().angle(); - mid_symbol->createRenderablesScaled(split.pos, orientation, output); + orientation = next_split.tangentVector().angle(); + mid_symbol->createRenderablesScaled(next_split.pos, orientation, output); if (i > 1) { mid_position += mid_symbol_distance_f; - next_split = SplitPathCoord::at(mid_position, split); - path.copy(split, next_split, processed_flags, processed_coords); - split = next_split; + next_split = SplitPathCoord::at(mid_position, next_split); } } }