Skip to content

Commit 9d7814d

Browse files
committed
push_clip()/pop_clip() in paint_v0
Necessary for getting the proper glyph extents, and matches HarfBuzz.
1 parent 56c33b9 commit 9d7814d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tables/colr.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,15 +937,16 @@ impl<'a> Table<'a> {
937937
let layers = self.layers.slice(start..end)?;
938938

939939
for layer in layers {
940+
painter.outline_glyph(layer.glyph_id);
941+
painter.push_clip();
940942
if layer.palette_index == 0xFFFF {
941943
// A special case.
942-
painter.outline_glyph(layer.glyph_id);
943944
painter.paint(Paint::Solid(foreground_color));
944945
} else {
945946
let color = self.palettes.get(palette, layer.palette_index)?;
946-
painter.outline_glyph(layer.glyph_id);
947947
painter.paint(Paint::Solid(color));
948948
}
949+
painter.pop_clip();
949950
}
950951

951952
Some(())

0 commit comments

Comments
 (0)