Clip text to viewport bounds instead of layout bounds

This commit is contained in:
Héctor Ramón Jiménez 2023-12-01 16:04:27 +01:00
parent 99899d49cc
commit 936d480267
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
23 changed files with 177 additions and 115 deletions

View file

@ -164,11 +164,13 @@ where
paragraph: &Self::Paragraph,
position: Point,
color: Color,
viewport: Rectangle,
) {
self.primitives.push(Primitive::Paragraph {
paragraph: paragraph.downgrade(),
position,
color,
viewport,
});
}
@ -177,11 +179,13 @@ where
editor: &Self::Editor,
position: Point,
color: Color,
viewport: Rectangle,
) {
self.primitives.push(Primitive::Editor {
editor: editor.downgrade(),
position,
color,
viewport,
});
}
@ -190,6 +194,7 @@ where
text: Text<'_, Self::Font>,
position: Point,
color: Color,
viewport: Rectangle,
) {
self.primitives.push(Primitive::Text {
content: text.content.to_string(),
@ -201,6 +206,7 @@ where
horizontal_alignment: text.horizontal_alignment,
vertical_alignment: text.vertical_alignment,
shaping: text.shaping,
viewport,
});
}
}