diff --git a/platform/darwin/src/MLNStyle.h b/platform/darwin/src/MLNStyle.h index 7d0284604..0a61ffc5f 100644 --- a/platform/darwin/src/MLNStyle.h +++ b/platform/darwin/src/MLNStyle.h @@ -59,13 +59,13 @@ MLN_EXPORT /** Returns default style as NSURL */ -+ (NSURL*) defaultStyleURL; ++ (nullable NSURL*) defaultStyleURL; /** Get predefined style by name @param withStyleName style name. */ -+ (MLNDefaultStyle*) predefinedStyle:(NSString*)withStyleName; ++ (nullable MLNDefaultStyle*) predefinedStyle:(NSString*)withStyleName; // MARK: Accessing Metadata About the Style diff --git a/platform/ios/src/MLNMapView.mm b/platform/ios/src/MLNMapView.mm index 1d6704091..9161b2ecc 100644 --- a/platform/ios/src/MLNMapView.mm +++ b/platform/ios/src/MLNMapView.mm @@ -1131,7 +1131,7 @@ public: - (CGSize)sizeForOrnament:(UIView *)view constraints:(NSMutableArray *)constraints { // avoid regenerating size constraints - CGSize size; + CGSize size = view.bounds.size; if(constraints && constraints.count > 0) { for (NSLayoutConstraint * constraint in constraints) { if([constraint.identifier isEqualToString:@"width"]) { @@ -1142,10 +1142,7 @@ public: } } } - else { - size = view.bounds.size; - } - + return size; } diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp index 6a18f183f..aa414d41b 100644 --- a/src/mbgl/text/placement.cpp +++ b/src/mbgl/text/placement.cpp @@ -672,9 +672,12 @@ SymbolInstanceReferences Placement::getSortedSymbols(const BucketPlacementData& void Placement::commit() { bool placementChanged = false; - assert(getPrevPlacement()); + if (!getPrevPlacement()) { + assert(false); + return; + } prevZoomAdjustment = getPrevPlacement()->zoomAdjustment(placementZoom); - float increment = getPrevPlacement()->symbolFadeChange(commitTime); + const float increment = getPrevPlacement()->symbolFadeChange(commitTime); // add the opacities from the current placement, and copy their current // values from the previous placement @@ -728,7 +731,7 @@ void Placement::commit() { } } - fadeStartTime = placementChanged ? commitTime : getPrevPlacement()->fadeStartTime; + fadeStartTime = placementChanged ? commitTime : (getPrevPlacement() ? getPrevPlacement()->fadeStartTime : TimePoint{}); } void Placement::updateLayerBuckets(const RenderLayer& layer, const TransformState& state, bool updateOpacities) const {