diff options
author | 2024-03-10 12:41:53 +0100 | |
---|---|---|
committer | 2024-03-10 12:41:53 +0100 | |
commit | 77bf93c32f281b0b760413320e33ffd7883a065d (patch) | |
tree | fe1f415596c742d561db291df1897f22e781181d /widget | |
parent | 4b33a450e0b358f5e95993d65f3de1afebeb3aca (diff) | |
download | iced-77bf93c32f281b0b760413320e33ffd7883a065d.tar.gz iced-77bf93c32f281b0b760413320e33ffd7883a065d.tar.bz2 iced-77bf93c32f281b0b760413320e33ffd7883a065d.zip |
Use integer coordinates for input caret
This should stop the caret from changing thickness
in screens with an integral scale factor.
Diffstat (limited to 'widget')
-rw-r--r-- | widget/src/text_editor.rs | 2 | ||||
-rw-r--r-- | widget/src/text_input.rs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index 018ffd9c..c7d62d92 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -538,7 +538,7 @@ where renderer.fill_quad( renderer::Quad { bounds: Rectangle { - x: position.x, + x: position.x.floor(), y: position.y, width: 1.0, height: self diff --git a/widget/src/text_input.rs b/widget/src/text_input.rs index 449524fc..9ed8480a 100644 --- a/widget/src/text_input.rs +++ b/widget/src/text_input.rs @@ -390,7 +390,8 @@ where Some(( renderer::Quad { bounds: Rectangle { - x: text_bounds.x + text_value_width, + x: (text_bounds.x + text_value_width) + .floor(), y: text_bounds.y, width: 1.0, height: text_bounds.height, |