aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralex-ds13 <145657253+alex-ds13@users.noreply.github.com>2025-11-25 16:11:31 +0000
committerPolesznyák Márk <contact@pml68.dev>2026-02-05 14:36:24 +0100
commitf5945f45d3e841671baafa3834291eb59117b354 (patch)
tree1479edf679bd5b2f7e23f3aa2bcad913d9885f05 /src
parentfix: take visual bounds into consideration when text is centered (diff)
downloadiced_selection-f5945f45d3e841671baafa3834291eb59117b354.tar.gz
fix: outbounds selecting when inside a scrollable
- If we were dragging a selection and move the mouse out of bounds of the text widget and an the same time it went out of bounds of a parent scrollable, the cursor would be levitated so we weren't getting it's cursor position. Now we land the cursor before checking the position.
Diffstat (limited to 'src')
-rw-r--r--src/text.rs2
-rw-r--r--src/text/rich.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/text.rs b/src/text.rs
index 204587b..ffd5ea2 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -444,7 +444,7 @@ where
}
Event::Mouse(mouse::Event::CursorMoved { .. })
| Event::Touch(touch::Event::FingerMoved { .. }) => {
- if let Some(position) = cursor.position()
+ if let Some(position) = cursor.land().position()
&& let Some(dragging) = state.dragging
{
let (line, index) = state
diff --git a/src/text/rich.rs b/src/text/rich.rs
index e54b64a..060ab26 100644
--- a/src/text/rich.rs
+++ b/src/text/rich.rs
@@ -657,7 +657,7 @@ where
}
Event::Mouse(mouse::Event::CursorMoved { .. })
| Event::Touch(touch::Event::FingerMoved { .. }) => {
- if let Some(position) = cursor.position()
+ if let Some(position) = cursor.land().position()
&& let Some(dragging) = state.dragging
{
let (line, index) = state