mirror of
https://github.com/godotengine/godot.git
synced 2024-09-20 06:22:24 +00:00
ColorPicker: ignore TextureRect expand mode during legacy picking
The color picker has a "legacy" fallback mode when `FEATURE_SCREEN_CAPTURE` is not supported by the current `DisplayServer`. It works by "freezing" the current view by making a huge `Popup` with a `TextureRect` inside covering the screen. Before this patch, said `TextureRect` could get cut off if its buffer was nominally bigger than the parent popup, such as when the `canvas_items` content scale mode is active. This is because the default TextureRect scaling logic only allows expanding the texture up. `EXPAND_IGNORE_SIZE` fixes that by allowing the texture to logically "shrink", filling the whole screen independently of the actual buffer size. Special thanks to Federico Fausto Santoro for helping with the diagnosis :D Co-Authored-By: Federico Fausto Santoro <fedyfausto@hotmail.com>
This commit is contained in:
parent
0a4aedb360
commit
ef48c4d306
|
@ -1556,6 +1556,7 @@ void ColorPicker::_pick_button_pressed_legacy() {
|
|||
|
||||
picker_texture_rect = memnew(TextureRect);
|
||||
picker_texture_rect->set_anchors_preset(Control::PRESET_FULL_RECT);
|
||||
picker_texture_rect->set_expand_mode(TextureRect::EXPAND_IGNORE_SIZE);
|
||||
picker_window->add_child(picker_texture_rect);
|
||||
picker_texture_rect->set_default_cursor_shape(CURSOR_POINTING_HAND);
|
||||
picker_texture_rect->connect(SceneStringName(gui_input), callable_mp(this, &ColorPicker::_picker_texture_input));
|
||||
|
|
Loading…
Reference in New Issue
Block a user