don't treat negative values as placement failure
This commit is contained in:
@@ -99,7 +99,12 @@ struct PlacementProperty {
|
||||
explicit PlacementProperty(float zoom, const PlacementRange &rotationRange)
|
||||
: zoom(zoom), rotationRange(rotationRange) {}
|
||||
|
||||
float zoom = -1.0f;
|
||||
inline operator bool() const {
|
||||
return !isnan(zoom) && zoom != std::numeric_limits<float>::infinity() &&
|
||||
rotationRange[0] != rotationRange[1];
|
||||
}
|
||||
|
||||
float zoom = std::numeric_limits<float>::infinity();
|
||||
PlacementRange rotationRange = {{0.0f, 0.0f}};
|
||||
};
|
||||
|
||||
|
||||
@@ -305,10 +305,9 @@ void Placement::addFeature(TextBucket& bucket,
|
||||
PlacementProperty place =
|
||||
collision.place(glyphs, anchor, anchor.scale, maxPlacementScale,
|
||||
padding, horizontal);
|
||||
|
||||
if (place.zoom >= 0.0f) {
|
||||
if (place) {
|
||||
bucket.addGlyphs(glyphs, place.zoom, place.rotationRange,
|
||||
zoom - zOffset);
|
||||
zoom - zOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user