diff options
| author | Polesznyák Márk <contact@pml68.dev> | 2025-12-24 22:43:10 +0100 |
|---|---|---|
| committer | Polesznyák Márk <contact@pml68.dev> | 2025-12-29 23:23:29 +0100 |
| commit | c49b3e1bb36e983ec9812e3645c45e7c1d37c491 (patch) | |
| tree | c5f0f04036ac1f556be445d0821ca32bd4617c2c | |
| parent | chore: bump version (diff) | |
| download | iced_selection-c49b3e1bb36e983ec9812e3645c45e7c1d37c491.tar.gz | |
chore: add missing hint_factor fields (iced update)
| -rw-r--r-- | src/text.rs | 1 | ||||
| -rw-r--r-- | src/text/rich.rs | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/text.rs b/src/text.rs index e106919..7f67b86 100644 --- a/src/text.rs +++ b/src/text.rs @@ -752,6 +752,7 @@ where align_y: format.align_y, shaping: format.shaping, wrapping: format.wrapping, + hint_factor: renderer.scale_factor(), }); state.paragraph.min_bounds() diff --git a/src/text/rich.rs b/src/text/rich.rs index 4c6319b..7d162a7 100644 --- a/src/text/rich.rs +++ b/src/text/rich.rs @@ -141,11 +141,15 @@ where /// Sets the message that will be produced when a link of the [`Rich`] text /// is clicked. + /// + /// If the spans of the [`Rich`] text contain no links, you may need to call + /// this method with `on_link_click(never)` in order for the compiler to infer + /// the proper `Link` generic type. pub fn on_link_click( mut self, - on_link_clicked: impl Fn(Link) -> Message + 'a, + on_link_click: impl Fn(Link) -> Message + 'a, ) -> Self { - self.on_link_click = Some(Box::new(on_link_clicked)); + self.on_link_click = Some(Box::new(on_link_click)); self } @@ -937,6 +941,7 @@ where align_y, shaping: Shaping::Advanced, wrapping, + hint_factor: renderer.scale_factor(), }; if state.spans != spans { @@ -954,6 +959,7 @@ where align_y, shaping: Shaping::Advanced, wrapping, + hint_factor: renderer.scale_factor(), }) { core::text::Difference::None => {} core::text::Difference::Bounds => { |
