From 7f3c72b84d2699b1ba8b0fcb5b1d38398bb9d0a8 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 30 Sep 2026 17:57:35 +0300 Subject: Fix modal floater re-centering against a different rect, which caused visual jump --- indra/llui/llmodaldialog.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/llui/llmodaldialog.cpp') diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index 73f3914160..0db9c20b20 100644 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -29,6 +29,7 @@ #include "llmodaldialog.h" #include "llemojihelper.h" +#include "llfloater.h" #include "llfocusmgr.h" #include "v4color.h" #include "v2math.h" @@ -306,8 +307,10 @@ void LLModalDialog::draw() void LLModalDialog::centerOnScreen() { - LLVector2 window_size = LLUI::getInstance()->getWindowSize(); - centerWithin(LLRect(0, 0, ll_round(window_size.mV[VX]), ll_round(window_size.mV[VY]))); + // Use the floater view's rect (same as LLFloater::center()) rather than the raw + // window size, otherwise a reshape after the initial centering (e.g. triggered by embedded + // media content settling) re-centers the dialog against a different rect. + centerWithin(gFloaterView->getRect()); } // static -- cgit v1.3