-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Improve drag-to-select text (add margins) #5797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
if let Some(first_row) = self.rows.first() { | ||
if pos.y < first_row.min_y() { | ||
if pos.y < first_row.min_y() - 5.0 { | ||
return self.begin(); | ||
} | ||
} | ||
if let Some(last_row) = self.rows.last() { | ||
if last_row.max_y() < pos.y { | ||
if last_row.max_y() + 5.0 < pos.y { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's give the 5.0
a name (const VMARGIN: f32
or something) and explain why its there 🙏
Preview available at https://egui-pr-preview.github.io/pr/5797-hjgalley-interact-margin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Might want to draw from
interaction.interact_radius
style instead of hard-coding the margin, but I didn't want to create a breaking change. If desired, I can follow up with a separate PR to address that concern.TextEdit
#5796