From 00fe29d4c55406278fa556eaf846b5d2cf0db076 Mon Sep 17 00:00:00 2001 From: Molly Lloyd Date: Tue, 19 Jun 2018 10:41:45 -0700 Subject: port zero line-width fix from gl-js --- mapbox-gl-js | 2 +- src/mbgl/shaders/line.cpp | 2 +- src/mbgl/shaders/line_pattern.cpp | 2 +- src/mbgl/shaders/line_sdf.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mapbox-gl-js b/mapbox-gl-js index a5a8dfe5b9..45b0be007c 160000 --- a/mapbox-gl-js +++ b/mapbox-gl-js @@ -1 +1 @@ -Subproject commit a5a8dfe5b90737dbb295eaca7f41c667ae4060a8 +Subproject commit 45b0be007cd5df6837e5381e067b9c2a42b78501 diff --git a/src/mbgl/shaders/line.cpp b/src/mbgl/shaders/line.cpp index 68d2dcc468..a4df33d9b6 100644 --- a/src/mbgl/shaders/line.cpp +++ b/src/mbgl/shaders/line.cpp @@ -148,7 +148,7 @@ void main() { offset = -1.0 * offset; float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0); - float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING; + float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING); // Scale the extrusion vector down to a normal and then up by the line width // of this vertex. diff --git a/src/mbgl/shaders/line_pattern.cpp b/src/mbgl/shaders/line_pattern.cpp index be88255e3c..374fc0a995 100644 --- a/src/mbgl/shaders/line_pattern.cpp +++ b/src/mbgl/shaders/line_pattern.cpp @@ -133,7 +133,7 @@ void main() { offset = -1.0 * offset; float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0); - float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING; + float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING); // Scale the extrusion vector down to a normal and then up by the line width // of this vertex. diff --git a/src/mbgl/shaders/line_sdf.cpp b/src/mbgl/shaders/line_sdf.cpp index c5d50566e8..9b6bf47301 100644 --- a/src/mbgl/shaders/line_sdf.cpp +++ b/src/mbgl/shaders/line_sdf.cpp @@ -171,7 +171,7 @@ void main() { offset = -1.0 * offset; float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0); - float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING; + float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING); // Scale the extrusion vector down to a normal and then up by the line width // of this vertex. -- cgit v1.2.1