OpenGL GAL: fix reserved vertices calculation in drawSegmentChain.

This commit is contained in:
Alex Shvartzkop 2023-07-09 16:41:05 +05:00
parent 8f9a67063a
commit 6a123e2381
1 changed files with 3 additions and 3 deletions

View File

@ -2284,13 +2284,13 @@ void OPENGL_GAL::drawSegmentChain( const std::function<VECTOR2D( int )>& 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