Small edit to improve code resiliency (#8540)

h/t @ChrisLoer catching this place where we were relying on member
initialization order.  While it _happened_ to be okay here, it's
unnecessarily fragile.
This commit is contained in:
Anand Thakker
2017-03-28 07:41:03 -04:00
committed by GitHub
parent f9462adf8a
commit 0abaae23b6

View File

@@ -252,11 +252,12 @@ void getLineGlyphs(std::back_insert_iterator<GlyphInstances> glyphs,
const bool glyphIsLogicallyForward = (glyphHorizontalOffsetFromAnchor >= 0) ^ upsideDown;
const float glyphDistanceFromAnchor = std::fabs(glyphHorizontalOffsetFromAnchor);
const auto initialSegmentEnd = getSegmentEnd(glyphIsLogicallyForward, line, anchorSegment);
VirtualSegment virtualSegment = {
anchor.point,
getSegmentEnd(glyphIsLogicallyForward, line, anchorSegment),
initialSegmentEnd,
anchorSegment,
getMinScaleForSegment(glyphDistanceFromAnchor, virtualSegment.anchor, virtualSegment.end),
getMinScaleForSegment(glyphDistanceFromAnchor, anchor.point, initialSegmentEnd),
std::numeric_limits<float>::infinity()
};