mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix Color Picking
With the 4.x-introduction of Windows the previous method for color picking was no longer working. This PR uses the following approach to reintroduce color-picking. When the Color-Picking-Button is pressed, a quasi-screenshot of the Window-content is created and displayed in a new Popup-Window. This new Window allows selecting colors by Mouse-Click. A Preview of the targeted Color is also displayed.
This commit is contained in:
parent
2572f6800a
commit
888add8418
5 changed files with 108 additions and 53 deletions
|
|
@ -1311,7 +1311,7 @@ void Viewport::_gui_show_tooltip() {
|
|||
Window *window = gui.tooltip_popup->get_parent_visible_window();
|
||||
Rect2i vr;
|
||||
if (gui.tooltip_popup->is_embedded()) {
|
||||
vr = gui.tooltip_popup->_get_embedder()->get_visible_rect();
|
||||
vr = gui.tooltip_popup->get_embedder()->get_visible_rect();
|
||||
} else {
|
||||
vr = window->get_usable_parent_rect();
|
||||
}
|
||||
|
|
@ -1832,7 +1832,7 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
|
|||
Window *w = Object::cast_to<Window>(this);
|
||||
if (w) {
|
||||
if (w->is_embedded()) {
|
||||
embedder = w->_get_embedder();
|
||||
embedder = w->get_embedder();
|
||||
|
||||
viewport_pos = get_final_transform().xform(mpos) + w->get_position(); // To parent coords.
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue