Make anchoring explicit and improve reusability of text pipelines

This commit is contained in:
Héctor Ramón Jiménez 2025-05-04 03:54:42 +02:00
parent d643bd5ba2
commit 6bf709e03e
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
13 changed files with 423 additions and 325 deletions

View file

@ -291,16 +291,18 @@ where
state,
renderer,
limits,
self.width,
Length::Shrink,
label,
self.text_line_height,
self.text_size,
self.font,
self.text_alignment,
alignment::Vertical::Top,
self.text_shaping,
self.text_wrapping,
widget::text::Format {
width: self.width,
height: Length::Shrink,
line_height: self.text_line_height,
size: self.text_size,
font: self.font,
align_x: self.text_alignment,
align_y: alignment::Vertical::Top,
shaping: self.text_shaping,
wrapping: self.text_wrapping,
},
)
} else {
layout::Node::new(Size::ZERO)
@ -406,8 +408,8 @@ where
crate::text::draw(
renderer,
style,
label_layout,
state.0.raw(),
label_layout.bounds(),
state.raw(),
crate::text::Style::default(),
viewport,
);