mirror of
https://github.com/danbulant/cushy
synced 2026-07-05 11:10:34 +00:00
Fixing selecting before/after the text
This commit is contained in:
parent
459dc3f96a
commit
f0c1aec40e
2 changed files with 6 additions and 1 deletions
|
|
@ -35,6 +35,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
`WindowAttributes::inner_size` is `None`.
|
`WindowAttributes::inner_size` is `None`.
|
||||||
- Container's layout and drawing functions now properly round up/down the
|
- Container's layout and drawing functions now properly round up/down the
|
||||||
measurements to ensure accurate rendering. Fixes [#158][158].
|
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
|
[158]: https://github.com/khonsulabs/cushy/issues/158
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -833,7 +833,7 @@ where
|
||||||
.round();
|
.round();
|
||||||
let mut location = location - padding;
|
let mut location = location - padding;
|
||||||
if location.y < 0 {
|
if location.y < 0 {
|
||||||
location.y = Px::ZERO;
|
return Cursor::default();
|
||||||
}
|
}
|
||||||
if location.x < 0 {
|
if location.x < 0 {
|
||||||
location.x = Px::ZERO;
|
location.x = Px::ZERO;
|
||||||
|
|
@ -885,6 +885,9 @@ where
|
||||||
let relative = relative + rect.size / 2;
|
let relative = relative + rect.size / 2;
|
||||||
|
|
||||||
let line_height = cache.measured.line_height.get();
|
let line_height = cache.measured.line_height.get();
|
||||||
|
if relative.y >= line_height {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
let xy = relative
|
let xy = relative
|
||||||
.x
|
.x
|
||||||
.get()
|
.get()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue