summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMolly Lloyd <molly@mapbox.com>2018-06-19 10:41:45 -0700
committerMolly Lloyd <molly@mapbox.com>2018-06-19 10:43:57 -0700
commit00fe29d4c55406278fa556eaf846b5d2cf0db076 (patch)
tree2671e148700febdcd7fb8ac343091cb6a6c95508 /src
parent4c7842045a231b40aa9f4c4765678f1cd5aa987d (diff)
downloadqtlocation-mapboxgl-00fe29d4c55406278fa556eaf846b5d2cf0db076.tar.gz
port zero line-width fix from gl-js
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/shaders/line.cpp2
-rw-r--r--src/mbgl/shaders/line_pattern.cpp2
-rw-r--r--src/mbgl/shaders/line_sdf.cpp2
3 files changed, 3 insertions, 3 deletions
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.