Skip to content

Fixed gradient polyline not always fully drawn + stability issues#1960

Merged
rborn merged 1 commit intoreact-native-maps:masterfrom
IjzerenHein:bugfix-ios-gradientpolyline-crash
Jan 17, 2018
Merged

Fixed gradient polyline not always fully drawn + stability issues#1960
rborn merged 1 commit intoreact-native-maps:masterfrom
IjzerenHein:bugfix-ios-gradientpolyline-crash

Conversation

@IjzerenHein
Copy link
Copy Markdown
Contributor

The new gradient polyline was not always completely visible, because the Matrix transform in the paths was not applied correctly. This happened because the segments were cached and could have the wrong matrix transform applied to them (this happens implicitely during calls to CGPathMoveToPoint & CGPathAddLineToPoint). This could cause the line to not be complete visible, because it was drawn behind the map-tile. (see screenshots below)
Also, I’ve witnessed some rare crashes due to the caching of the segments. Apparently, the class was accessed from multiple threads which led to threading issues. Removing the segments cache fixed this problem as well.

Before fix:
image

After fix:
image

The gradient polyline was not always completely visible, because the Matrix transform in the paths was not applied correctly. This happened, because the segments were cached and could have the wrong matrix transform applied to them. This could cause the line to not visible, because it will below the map-tile.
Also, I’ve witnessed some rare crashes due to the caching of the segments. Apparently, the class was accessed from multiple threads which led to threading issues. Removing the segments cache fixed this problem as well.
@rborn
Copy link
Copy Markdown
Collaborator

rborn commented Jan 12, 2018

LGTM

@alvelig 🐽

@rborn rborn merged commit 5ec275c into react-native-maps:master Jan 17, 2018
@alvelig
Copy link
Copy Markdown
Contributor

alvelig commented Jan 18, 2018

Sorry, I missed this one. LGTM and thanks!

pinpong pushed a commit to pinpong/react-native-maps that referenced this pull request Feb 28, 2025
…e-maps#1960)

The gradient polyline was not always completely visible, because the Matrix transform in the paths was not applied correctly. This happened, because the segments were cached and could have the wrong matrix transform applied to them. This could cause the line to not visible, because it will below the map-tile.
Also, I’ve witnessed some rare crashes due to the caching of the segments. Apparently, the class was accessed from multiple threads which led to threading issues. Removing the segments cache fixed this problem as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants