Fix clipping of text in iced_tiny_skia

This commit is contained in:
Héctor Ramón Jiménez 2024-02-11 04:03:01 +01:00
parent 52bd0d4138
commit c6cf2bc521
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 49 additions and 42 deletions

View file

@ -98,12 +98,7 @@ pub fn measure(buffer: &cosmic_text::Buffer) -> Size {
(run.line_w.max(width), total_lines + 1)
});
let (max_width, max_height) = buffer.size();
Size::new(
width.min(max_width),
(total_lines as f32 * buffer.metrics().line_height).min(max_height),
)
Size::new(width, total_lines as f32 * buffer.metrics().line_height)
}
/// Returns the attributes of the given [`Font`].