File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 118118 <return type =" Vector2i" />
119119 <description >
120120 Returns the window's position including its border.
121+ [b]Note:[/b] If [member visible] is [code]false[/code], this method returns the same value as [member position].
121122 </description >
122123 </method >
123124 <method name =" get_size_with_decorations" qualifiers =" const" >
124125 <return type =" Vector2i" />
125126 <description >
126127 Returns the window's size including its border.
128+ [b]Note:[/b] If [member visible] is [code]false[/code], this method returns the same value as [member size].
127129 </description >
128130 </method >
129131 <method name =" get_theme_color" qualifiers =" const" >
Original file line number Diff line number Diff line change @@ -408,6 +408,16 @@ Point2i Window::get_position_with_decorations() const {
408408 if (window_id != DisplayServer::INVALID_WINDOW_ID) {
409409 return DisplayServer::get_singleton ()->window_get_position_with_decorations (window_id);
410410 }
411+ if (visible && is_embedded () && !get_flag (Window::FLAG_BORDERLESS)) {
412+ Size2 border_offset;
413+ if (theme_cache.embedded_border .is_valid ()) {
414+ border_offset = theme_cache.embedded_border ->get_offset ();
415+ }
416+ if (theme_cache.embedded_unfocused_border .is_valid ()) {
417+ border_offset = border_offset.max (theme_cache.embedded_unfocused_border ->get_offset ());
418+ }
419+ return position - border_offset;
420+ }
411421 return position;
412422}
413423
@@ -416,6 +426,16 @@ Size2i Window::get_size_with_decorations() const {
416426 if (window_id != DisplayServer::INVALID_WINDOW_ID) {
417427 return DisplayServer::get_singleton ()->window_get_size_with_decorations (window_id);
418428 }
429+ if (visible && is_embedded () && !get_flag (Window::FLAG_BORDERLESS)) {
430+ Size2 border_size;
431+ if (theme_cache.embedded_border .is_valid ()) {
432+ border_size = theme_cache.embedded_border ->get_minimum_size ();
433+ }
434+ if (theme_cache.embedded_unfocused_border .is_valid ()) {
435+ border_size = border_size.max (theme_cache.embedded_unfocused_border ->get_minimum_size ());
436+ }
437+ return size + border_size;
438+ }
419439 return size;
420440}
421441
You can’t perform that action at this time.
0 commit comments