Compute actual size of GUI objects lazily

This shifts the responsibility of updating the actual size more towards
IGUIObject, and enables only ever doing it when the value is actually
needed. This allows us to remove the delay of size changed
notifications, since the value is now already recalculated as
infrequently as possible anyways.

All of that ensures that the actual size (returned by GetActualSize) is
always up-to-date e.g. when reading it from the parent, which was
previously broken.

Fixes #8200
This commit is contained in:
Vantha
2026-03-05 12:31:47 +01:00
committed by Vantha
parent d5384ad742
commit 5a92c22d90
37 changed files with 323 additions and 371 deletions
@@ -1,4 +1,4 @@
/* Copyright (C) 2025 Wildfire Games.
/* Copyright (C) 2026 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -73,9 +73,10 @@ bool SetCRectField(JSContext* cx, unsigned argc, JS::Value* vp)
return false;
wrapper->GetMutable().*RectMember.*Member = static_cast<float>(val);
wrapper->Set(wrapper->GetMutable(), true); // causes CGUISimpleSetting to actually process the change
args.rval().setUndefined();
wrapper->DeferSettingChange();
return true;
}