You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-31 18:41:20 +00:00
Merge pull request #112031 from bruvzg/vm_os_f
Fix embedded window frame oversampling, fix DPITexture using uninitialized size in some conditions.
This commit is contained in:
@@ -143,18 +143,13 @@ void CanvasItem::_redraw_callback() {
|
||||
|
||||
if (is_visible_in_tree()) {
|
||||
drawing = true;
|
||||
Ref<TextServer> ts = TextServerManager::get_singleton()->get_primary_interface();
|
||||
if (ts.is_valid()) {
|
||||
ts->set_current_drawn_item_oversampling(get_viewport()->get_oversampling());
|
||||
}
|
||||
TextServer::set_current_drawn_item_oversampling(get_viewport()->get_oversampling());
|
||||
current_item_drawn = this;
|
||||
notification(NOTIFICATION_DRAW);
|
||||
emit_signal(SceneStringName(draw));
|
||||
GDVIRTUAL_CALL(_draw);
|
||||
current_item_drawn = nullptr;
|
||||
if (ts.is_valid()) {
|
||||
ts->set_current_drawn_item_oversampling(0.0);
|
||||
}
|
||||
TextServer::set_current_drawn_item_oversampling(0.0);
|
||||
drawing = false;
|
||||
draw_commands_dirty = true;
|
||||
}
|
||||
|
||||
@@ -356,6 +356,8 @@ void Viewport::_sub_window_update(Window *p_window) {
|
||||
const Rect2i r = Rect2i(p_window->get_position(), p_window->get_size());
|
||||
|
||||
if (!p_window->get_flag(Window::FLAG_BORDERLESS)) {
|
||||
TextServer::set_current_drawn_item_oversampling(get_oversampling());
|
||||
|
||||
Ref<StyleBox> panel = gui.subwindow_focused == p_window ? p_window->theme_cache.embedded_border : p_window->theme_cache.embedded_unfocused_border;
|
||||
panel->draw(sw.canvas_item, r);
|
||||
|
||||
@@ -386,6 +388,8 @@ void Viewport::_sub_window_update(Window *p_window) {
|
||||
bool pressed = gui.subwindow_focused == sw.window && gui.subwindow_drag == SUB_WINDOW_DRAG_CLOSE && gui.subwindow_drag_close_inside;
|
||||
Ref<Texture2D> close_icon = pressed ? p_window->theme_cache.close_pressed : p_window->theme_cache.close;
|
||||
close_icon->draw(sw.canvas_item, r.position + Vector2(r.size.width - close_h_ofs, -close_v_ofs));
|
||||
|
||||
TextServer::set_current_drawn_item_oversampling(0.0);
|
||||
}
|
||||
|
||||
const Transform2D xform = sw.window->window_transform * sw.window->stretch_transform;
|
||||
@@ -3048,7 +3052,8 @@ bool Viewport::_sub_windows_forward_input(const Ref<InputEvent> &p_event) {
|
||||
|
||||
int close_h_ofs = sw.window->theme_cache.close_h_offset;
|
||||
int close_v_ofs = sw.window->theme_cache.close_v_offset;
|
||||
Ref<Texture2D> close_icon = sw.window->theme_cache.close;
|
||||
bool pressed = gui.subwindow_focused == sw.window && gui.subwindow_drag == SUB_WINDOW_DRAG_CLOSE && gui.subwindow_drag_close_inside;
|
||||
Ref<Texture2D> close_icon = pressed ? sw.window->theme_cache.close_pressed : sw.window->theme_cache.close;
|
||||
|
||||
Rect2 close_rect;
|
||||
close_rect.position = Vector2(r.position.x + r.size.x - close_h_ofs, r.position.y - close_v_ofs);
|
||||
|
||||
Reference in New Issue
Block a user