Don't fill out of viewport text

This commit is contained in:
Cory Forsstrom 2024-09-27 08:58:33 -07:00
parent 75548373a7
commit 509a0a574a
No known key found for this signature in database
GPG key ID: 64D6B5851FFCAC9E

View file

@ -334,6 +334,10 @@ pub fn draw<Renderer>(
{
let bounds = layout.bounds();
if !bounds.intersects(viewport) {
return;
}
let x = match paragraph.horizontal_alignment() {
alignment::Horizontal::Left => bounds.x,
alignment::Horizontal::Center => bounds.center_x(),