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
Describe the bug
When a color picker made by calling color_edit_button_srgb (or the other color_edit funcs) is displaced due to the window being too small for it to render in it's natural position, clicking inside the picker popup will cause it to close.
So if a picker popup is displaced up by half it's height, clicking on the lower half of the it works as expected (no close) and clicking on the upper half will cause it to close. I believe this is due to the positioning of the picker popup not being updated when the displacement happens. The gif in the screenshots section demonstrates the bug.
To Reproduce
Steps to reproduce the behavior:
Create a eframe::run_simple_native with a default CentralPanel application
Add some space using ui.add_space() and add a single color_edit_* widget
Shrink window to a small size so that the picker popup would displace a fair amount
Open picker popup and try clicking on it in various places and it should close.
Expected behavior
I expect the picker popup to not close when the click happens inside of it regardless if it's displaced or not.
Screenshots
Desktop (please complete the following information):
OS: Ubuntu 22.04
Browser Firefox (but doesn't apply since this is native)
Version 0.22.0
Additional context Perhaps #955 is related to this although I haven't looked into it. Reread the description for this, doesn't sound very related
A quick fix I applied locally to understand the bug is this in containers/area.rs. I'm not sure if this negatively affects other widgets or if any other widgets are affected by a similar bug
diff --git a/crates/egui/src/containers/area.rs b/crates/egui/src/containers/area.rs
index f493c20c..760ca141 100644
--- a/crates/egui/src/containers/area.rs+++ b/crates/egui/src/containers/area.rs@@ -271,7 +271,7 @@ impl Area {
}
// interact right away to prevent frame-delay
- let move_response = {+ let mut move_response = {
let interact_id = layer_id.id.with("move");
let sense = if movable {
Sense::click_and_drag()
@@ -321,6 +321,7 @@ impl Area {
ctx.constrain_window_rect_to_area(state.rect(), drag_bounds)
.left_top(),
);
+ move_response = move_response.with_new_rect(Rect::from(state.rect()));
}
Prepared {
The text was updated successfully, but these errors were encountered:
Describe the bug
When a color picker made by calling
color_edit_button_srgb
(or the other color_edit funcs) is displaced due to the window being too small for it to render in it's natural position, clicking inside the picker popup will cause it to close.So if a picker popup is displaced up by half it's height, clicking on the lower half of the it works as expected (no close) and clicking on the upper half will cause it to close. I believe this is due to the positioning of the picker popup not being updated when the displacement happens. The gif in the screenshots section demonstrates the bug.
To Reproduce
Steps to reproduce the behavior:
eframe::run_simple_native
with a defaultCentralPanel
applicationui.add_space()
and add a singlecolor_edit_*
widgetThe steps above are implemented in a simple repro using eframe and egui in the below gist
https://gist.github.com/IllusionMan1212/d9b2f71d1977db1579df9d30d143fcdd
Expected behavior
I expect the picker popup to not close when the click happens inside of it regardless if it's displaced or not.
Screenshots
Desktop (please complete the following information):
Additional context
Perhaps #955 is related to this although I haven't looked into it.Reread the description for this, doesn't sound very relatedA quick fix I applied locally to understand the bug is this in
containers/area.rs
. I'm not sure if this negatively affects other widgets or if any other widgets are affected by a similar bugThe text was updated successfully, but these errors were encountered: