mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-28 09:09:13 +01:00
[VARC] Fix sign of returned extents
This commit is contained in:
1 parent
e9134c8ce3
commit
302302d9c5
2 files changed
+6
-3
No files matched your search
@@ -204,7 +204,7 @@ struct VARC
|
||||
release_scratch (scratch);
|
||||
|
||||
if (ret)
|
||||
*extents = f_extents.to_glyph_extents ();
|
||||
*extents = f_extents.to_glyph_extents (font->x_scale < 0, font->y_scale < 0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
+5
-2
@@ -85,13 +85,16 @@ struct hb_extents_t
|
||||
}
|
||||
}
|
||||
|
||||
hb_glyph_extents_t to_glyph_extents () const
|
||||
hb_glyph_extents_t to_glyph_extents (bool xneg = false, bool yneg = false) const
|
||||
{
|
||||
hb_position_t x0 = (hb_position_t) roundf (xmin);
|
||||
hb_position_t y0 = (hb_position_t) roundf (ymin);
|
||||
hb_position_t x1 = (hb_position_t) roundf (xmax);
|
||||
hb_position_t y1 = (hb_position_t) roundf (ymax);
|
||||
return hb_glyph_extents_t {x0, y0, x1 - x0, y1 - y0};
|
||||
return hb_glyph_extents_t {xneg ? x1 : x0,
|
||||
yneg ? y0 : y1,
|
||||
xneg ? x0 - x1 : x1 - x0,
|
||||
yneg ? y1 - y0 : y0 - y1};
|
||||
}
|
||||
|
||||
float xmin = 0.f;
|
||||
|
||||
Reference in new issue
Block a user