Skip to content

Commit

Permalink
Don't fill out of viewport text
Browse files Browse the repository at this point in the history
  • Loading branch information
tarkah committed Sep 27, 2024
1 parent 7554837 commit 509a0a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/widget/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 509a0a5

Please sign in to comment.