summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Libraries/LibGUI/Dialog.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Libraries/LibGUI/Dialog.cpp b/Libraries/LibGUI/Dialog.cpp
index 56e0067c87..66c5bd59e8 100644
--- a/Libraries/LibGUI/Dialog.cpp
+++ b/Libraries/LibGUI/Dialog.cpp
@@ -48,9 +48,7 @@ int Dialog::exec()
if (parent() && parent()->is_window()) {
auto& parent_window = *static_cast<Window*>(parent());
if (parent_window.is_visible()) {
- auto new_rect = rect();
- new_rect.center_within(parent_window.rect());
- set_rect(new_rect);
+ center_within(parent_window);
} else {
center_on_screen();
}