From 9c9b1810b76c81f4ed62fda35c6f6f3439a26783 Mon Sep 17 00:00:00 2001 From: vrld Date: Fri, 30 Dec 2011 14:09:26 +0100 Subject: [PATCH] Decrese core-line width when overdrawing to preserve original line width. --- src/modules/graphics/opengl/Graphics.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index ce9068343..814f32efa 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -859,6 +859,11 @@ namespace opengl float halfwidth = lineWidth/2.f; float inv_hw = 1.f / halfwidth; + // Overdraw changes visible line width. account for that. + // Value of 0.15 chosen empirically. + if (lineStyle == LINE_SMOOTH) + halfwidth -= .15f; + // get line vertex boundaries // if not looping, extend the line at the beginning, else use last point as `p' r = Vector(coords[0], coords[1]);