mapbox / DEPRECATED-mapbox-ios-sdk

REPLACED – use https://www.mapbox.com/ios-sdk instead
https://github.com/mapbox/mapbox-gl-native
Other
322 stars 8 forks source link

Crash on constraint map #201

Open incanus opened 11 years ago

incanus commented 11 years ago

Assigned to MapBox iOS SDK #734. Validate constraints before allowing them to be set.

gfalasca commented 11 years ago

Hi, we've encountered the same issue reported by jan.klimke. Do you have any news about it?

gfalasca commented 11 years ago

I've seen that when the infinite loop with crash occurs, in setProjectedConstraintsSouthWest the values (northEast.x - southWest.x) and/or (northEast.y - southWest.y) are negative. fabs() seems to have fixed the issue:

(void)setProjectedConstraintsSouthWest:(RMProjectedPoint)southWest northEast:(RMProjectedPoint)northEast { _constrainMovement = _constrainMovementByUser = YES; _constrainingProjectedBounds = RMProjectedRectMake(southWest.x, southWest.y, fabs(northEast.x - southWest.x), fabs(northEast.y - southWest.y)); _constrainingProjectedBoundsByUser = RMProjectedRectMake(southWest.x, southWest.y, fabs(northEast.x - southWest.x), fabs(northEast.y - southWest.y)); }

incanus commented 10 years ago

To be clear this is map pan constraints, not related to auto layout.