Don't render glyphs located outside of BufferElement's bounds

This commit is contained in:
Antonio Scandurra
2021-04-01 11:19:50 +02:00
parent c525d7c712
commit e487aa5cbd
3 changed files with 19 additions and 9 deletions
+6 -1
View File
@@ -134,7 +134,12 @@ impl Element for Label {
layout: &mut Self::LayoutState,
ctx: &mut PaintContext,
) -> Self::PaintState {
layout.line.paint(bounds, layout.colors.as_slice(), ctx)
layout.line.paint(
bounds.origin(),
RectF::new(vec2f(0., 0.), bounds.size()),
layout.colors.as_slice(),
ctx,
)
}
fn dispatch_event(