mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 01:04:06 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user