From 6a123e238152ef5604e49625faf0da822dae3680 Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Sun, 9 Jul 2023 16:41:05 +0500 Subject: [PATCH] OpenGL GAL: fix reserved vertices calculation in drawSegmentChain. --- common/gal/opengl/opengl_gal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 221c5c9d1f..de92c2b46b 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -2284,13 +2284,13 @@ void OPENGL_GAL::drawSegmentChain( const std::function& aPointG auto start = aPointGetter( i - 1 ); auto end = aPointGetter( i ); - VECTOR2D startEndVector = start - end; + VECTOR2D startEndVector = end - start; double lineLength = startEndVector.EuclideanNorm(); float startx = start.x; - float starty = end.y; + float starty = start.y; float endx = start.x + lineLength; - float endy = end.y + lineLength; + float endy = start.y + lineLength; // Be careful about floating point rounding. As we draw segments in larger and larger // coordinates, the shader (which uses floats) will lose precision and stop drawing small