Use integer coordinates for input caret

This should stop the caret from changing thickness
in screens with an integral scale factor.
This commit is contained in:
Héctor Ramón Jiménez 2024-03-10 12:41:53 +01:00
parent 4b33a450e0
commit 77bf93c32f
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 3 additions and 2 deletions

View file

@ -538,7 +538,7 @@ where
renderer.fill_quad( renderer.fill_quad(
renderer::Quad { renderer::Quad {
bounds: Rectangle { bounds: Rectangle {
x: position.x, x: position.x.floor(),
y: position.y, y: position.y,
width: 1.0, width: 1.0,
height: self height: self

View file

@ -390,7 +390,8 @@ where
Some(( Some((
renderer::Quad { renderer::Quad {
bounds: Rectangle { bounds: Rectangle {
x: text_bounds.x + text_value_width, x: (text_bounds.x + text_value_width)
.floor(),
y: text_bounds.y, y: text_bounds.y,
width: 1.0, width: 1.0,
height: text_bounds.height, height: text_bounds.height,