[Impeller] ensure fp rounding errors don't cause us to lose a row of pixels when computing text positions. (flutter/engine#54015)
Dividing then multipliying can lead to position values like 432.99987 which end up losing a pixel.
This commit is contained in:
parent
08c7b8d6e2
commit
bb010156f5
@ -254,8 +254,9 @@ bool TextContents::Render(const ContentContext& renderer,
|
|||||||
for (const Point& point : unit_points) {
|
for (const Point& point : unit_points) {
|
||||||
Point position;
|
Point position;
|
||||||
if (is_translation_scale) {
|
if (is_translation_scale) {
|
||||||
position = screen_glyph_position +
|
position = (screen_glyph_position +
|
||||||
(basis_transform * point * scaled_bounds.GetSize());
|
(basis_transform * point * scaled_bounds.GetSize()))
|
||||||
|
.Round();
|
||||||
} else {
|
} else {
|
||||||
position = entity_transform * (glyph_position.position +
|
position = entity_transform * (glyph_position.position +
|
||||||
scaled_bounds.GetLeftTop() +
|
scaled_bounds.GetLeftTop() +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user