Apply Transformation to RawText primitives

This commit is contained in:
Héctor Ramón Jiménez 2024-02-02 14:43:04 +01:00
parent a06682ff42
commit b3adf31845
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 21 additions and 19 deletions

View file

@ -181,20 +181,13 @@ impl<'a> Layer<'a> {
clip_bounds: *clip_bounds * transformation,
}));
}
graphics::Primitive::RawText(graphics::text::Raw {
buffer,
position,
color,
clip_bounds,
}) => {
graphics::Primitive::RawText(raw) => {
let layer = &mut layers[current_layer];
layer.text.push(Text::Raw(graphics::text::Raw {
buffer: buffer.clone(),
position: *position * transformation,
color: *color,
clip_bounds: *clip_bounds * transformation,
}));
layer.text.push(Text::Raw {
raw: raw.clone(),
transformation,
});
}
Primitive::Quad {
bounds,