summaryrefslogtreecommitdiffstats
path: root/native/src/widget/text_input.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2021-12-13 15:36:15 +0700
committerLibravatar GitHub <noreply@github.com>2021-12-13 15:36:15 +0700
commite24eaa7c665f6b73aa4e9bac4b723cd8d24b78e1 (patch)
treec94edd5f2ffbabfe8dcd56ab3933f5aabc2ecd83 /native/src/widget/text_input.rs
parentbc15bfdb67394eb6eaaacec96d919f0f6cfe4efb (diff)
parentd06e6bfb5111c1f2d2fd43c10a0c69870539742f (diff)
downloadiced-e24eaa7c665f6b73aa4e9bac4b723cd8d24b78e1.tar.gz
iced-e24eaa7c665f6b73aa4e9bac4b723cd8d24b78e1.tar.bz2
iced-e24eaa7c665f6b73aa4e9bac4b723cd8d24b78e1.zip
Merge pull request #1155 from AlisCode/refactor/decouple_image
Decouple `image::Handle` from `iced_native` and lower trait bound on `text::Renderer::Font`
Diffstat (limited to 'native/src/widget/text_input.rs')
-rw-r--r--native/src/widget/text_input.rs21
1 files changed, 11 insertions, 10 deletions
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs
index bec1db48..fb9f0834 100644
--- a/native/src/widget/text_input.rs
+++ b/native/src/widget/text_input.rs
@@ -219,7 +219,7 @@ where
&value,
size,
position,
- self.font,
+ self.font.clone(),
);
(
@@ -251,7 +251,7 @@ where
&value,
size,
left,
- self.font,
+ self.font.clone(),
);
let (right_position, right_offset) =
@@ -261,7 +261,7 @@ where
&value,
size,
right,
- self.font,
+ self.font.clone(),
);
let width = right_position - left_position;
@@ -300,7 +300,7 @@ where
&text
},
size,
- self.font,
+ self.font.clone(),
);
let render = |renderer: &mut Renderer| {
@@ -319,7 +319,7 @@ where
} else {
self.style_sheet.value_color()
},
- font: self.font,
+ font: self.font.clone(),
bounds: Rectangle {
y: text_bounds.center_y(),
width: f32::INFINITY,
@@ -414,7 +414,7 @@ where
find_cursor_position(
renderer,
text_layout.bounds(),
- self.font,
+ self.font.clone(),
self.size,
&value,
&self.state,
@@ -434,7 +434,7 @@ where
let position = find_cursor_position(
renderer,
text_layout.bounds(),
- self.font,
+ self.font.clone(),
self.size,
&self.value,
&self.state,
@@ -481,7 +481,7 @@ where
let position = find_cursor_position(
renderer,
text_layout.bounds(),
- self.font,
+ self.font.clone(),
self.size,
&value,
&self.state,
@@ -962,13 +962,14 @@ where
{
let size = size.unwrap_or(renderer.default_size());
- let offset = offset(renderer, text_bounds, font, size, &value, &state);
+ let offset =
+ offset(renderer, text_bounds, font.clone(), size, &value, &state);
renderer
.hit_test(
&value.to_string(),
size.into(),
- font,
+ font.clone(),
Size::INFINITY,
Point::new(x + offset, text_bounds.height / 2.0),
true,