You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working on a transformed layer, selecting a region of text by dragging on egui::TextEdit or egui::Label doesn't work properly.
Clicking on a transformed egui::TextEdit doesn't focus the widget. Holding the button for a bit before releasing works for some reason. Interestingly, this also happens when clicking the edge of the widget, even without transformation.
// We detect clicks/hover on a "interact_rect" that is slightly larger than
// self.rect. See Context::interact.
// This means we can be hovered and clicked even though `!self.rect.contains(pos)` is true,
// hence the extra complexity here.
ifself.contains_pointer(){
false
}elseifletSome(pos) = pointer.interact_pos(){
!self.rect.contains(pos)
}else{
false// clicked without a pointer, weird
}
In line 188, the untransformed rect is checked against the untransformed pointer position.
When the widget is transformed away, the click happens outside the original area and the focus is removed.
I tried accessing the transform from this function using self.ctx.memory(), however this freezes the app, probably because the memory is already being accessed at this point?
I don't know the code well enough yet to be able to fix this.
The text was updated successfully, but these errors were encountered:
Description
When working on a transformed layer, selecting a region of text by dragging on
egui::TextEdit
oregui::Label
doesn't work properly.Clicking on a transformed
egui::TextEdit
doesn't focus the widget. Holding the button for a bit before releasing works for some reason. Interestingly, this also happens when clicking the edge of the widget, even without transformation.2024-03-15.21-49-13.mp4
Steps to reproduce
egui::CentralPanel
:Thoughts
It seems like when handling these interactions, the transformation isn't applied properly.
For the focus issue, I think I have identified the relevant code snippet:
egui/crates/egui/src/response.rs
Lines 181 to 191 in bf7ffb9
In line 188, the untransformed rect is checked against the untransformed pointer position.
When the widget is transformed away, the click happens outside the original area and the focus is removed.
I tried accessing the transform from this function using
self.ctx.memory()
, however this freezes the app, probably because the memory is already being accessed at this point?I don't know the code well enough yet to be able to fix this.
The text was updated successfully, but these errors were encountered: