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 @@ -397,6 +397,16 @@ Point2i Window::get_position_with_decorations() const {
397397 if (window_id != DisplayServer::INVALID_WINDOW_ID) {
398398 return DisplayServer::get_singleton ()->window_get_position_with_decorations (window_id);
399399 }
400+ if (visible && is_embedded () && !get_flag (Window::FLAG_BORDERLESS)) {
401+ Size2 border_offset;
402+ if (theme_cache.embedded_border .is_valid ()) {
403+ border_offset = theme_cache.embedded_border ->get_offset ();
404+ }
405+ if (theme_cache.embedded_unfocused_border .is_valid ()) {
406+ border_offset = border_offset.max (theme_cache.embedded_unfocused_border ->get_offset ());
407+ }
408+ return position - border_offset;
409+ }
400410 return position;
401411}
402412
@@ -405,6 +415,16 @@ Size2i Window::get_size_with_decorations() const {
405415 if (window_id != DisplayServer::INVALID_WINDOW_ID) {
406416 return DisplayServer::get_singleton ()->window_get_size_with_decorations (window_id);
407417 }
418+ if (visible && is_embedded () && !get_flag (Window::FLAG_BORDERLESS)) {
419+ Size2 border_size;
420+ if (theme_cache.embedded_border .is_valid ()) {
421+ border_size = theme_cache.embedded_border ->get_minimum_size ();
422+ }
423+ if (theme_cache.embedded_unfocused_border .is_valid ()) {
424+ border_size = border_size.max (theme_cache.embedded_unfocused_border ->get_minimum_size ());
425+ }
426+ return size + border_size;
427+ }
408428 return size;
409429}
410430
You can’t perform that action at this time.
0 commit comments