summaryrefslogtreecommitdiffstats
path: root/widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-03-10 12:57:20 +0100
committerLibravatar GitHub <noreply@github.com>2024-03-10 12:57:20 +0100
commitf00e7c4dc5f3fea085345a11c65133038be6342a (patch)
treefe1f415596c742d561db291df1897f22e781181d /widget
parent4b33a450e0b358f5e95993d65f3de1afebeb3aca (diff)
parent77bf93c32f281b0b760413320e33ffd7883a065d (diff)
downloadiced-f00e7c4dc5f3fea085345a11c65133038be6342a.tar.gz
iced-f00e7c4dc5f3fea085345a11c65133038be6342a.tar.bz2
iced-f00e7c4dc5f3fea085345a11c65133038be6342a.zip
Merge pull request #2320 from iced-rs/fix/input-cursor-alignment
Use integer coordinates for input caret
Diffstat (limited to 'widget')
-rw-r--r--widget/src/text_editor.rs2
-rw-r--r--widget/src/text_input.rs3
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,