Fixing selecting before/after the text

This commit is contained in:
Jonathan Johnson 2024-07-26 09:33:33 -07:00
parent 459dc3f96a
commit f0c1aec40e
No known key found for this signature in database
GPG key ID: A66D6A34D6620579
2 changed files with 6 additions and 1 deletions

View file

@ -35,6 +35,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`WindowAttributes::inner_size` is `None`.
- Container's layout and drawing functions now properly round up/down the
measurements to ensure accurate rendering. Fixes [#158][158].
- `Input` selection handling when dragging below or above the text field is now
handled correctly.
[158]: https://github.com/khonsulabs/cushy/issues/158

View file

@ -833,7 +833,7 @@ where
.round();
let mut location = location - padding;
if location.y < 0 {
location.y = Px::ZERO;
return Cursor::default();
}
if location.x < 0 {
location.x = Px::ZERO;
@ -885,6 +885,9 @@ where
let relative = relative + rect.size / 2;
let line_height = cache.measured.line_height.get();
if relative.y >= line_height {
continue;
}
let xy = relative
.x
.get()