Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

improve round line joins for semi-transparent lines #1839

Merged
merged 2 commits into from
Jul 8, 2015
Merged

Conversation

ansis
Copy link
Contributor

@ansis ansis commented Jul 6, 2015

@ansis
Copy link
Contributor Author

ansis commented Jul 7, 2015

@incanus changing tolerance from 3 to 10 looks good to me. Can you check if it looks ok to you?

diff --git a/src/mbgl/map/annotation.cpp b/src/mbgl/map/annotation.cpp
index a0f65cd..71b479d 100644
--- a/src/mbgl/map/annotation.cpp
+++ b/src/mbgl/map/annotation.cpp
@@ -133,7 +133,7 @@ AnnotationManager::addTileFeature(const uint32_t annotationID,

         features.push_back(Convert::create(Tags(), featureType, rings));

-        shapeTilers.emplace(annotationID, std::make_unique<GeoJSONVT>(features, maxZoom));
+        shapeTilers.emplace(annotationID, std::make_unique<GeoJSONVT>(features, maxZoom, 4, 100, 10));

     } else {

@incanus incanus added this to the iOS Beta 3 milestone Jul 7, 2015
@incanus
Copy link
Contributor

incanus commented Jul 7, 2015

changing tolerance from 3 to 10 looks good to me. Can you check if it looks ok to you?

Looks pretty good to me as well.

@incanus
Copy link
Contributor

incanus commented Jul 7, 2015

img_0657
img_0658

ansis added 2 commits July 8, 2015 16:16
mapbox/mapbox-gl-js#1359

Round line joins used to be drawn by adding a semicircle cap to the end
of each segment. This looked fine for opaque lines not for
semi-transparent lines.

This changes the triangulation so that round line joins don't overlap
with segments. The gap between segments is filled with small triangles
that look like pie slices. The edge of the round linejoin is made up of
many short straight lines that look round at the sizes we draw lines.

Since sharp angles are infrequent, this does not significantly affect
the total number of triangles created.

Joins for angles that are really sharp are still drawn with overlap.
to make them look better when drawn semi-transparently
@ansis ansis merged commit 03c4ed7 into master Jul 8, 2015
@ansis ansis removed the in progress label Jul 8, 2015
@friedbunny friedbunny deleted the round-join branch July 17, 2015 02:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants