1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-05-10 03:28:43 +02:00

Avoid unnecessary panel updates by using an Epsilon comparison when scrolling children

This commit is contained in:
Ell 2022-01-09 01:15:05 +01:00
parent c28f6d858c
commit 80a6c6b5e2
2 changed files with 2 additions and 1 deletions

View file

@ -25,6 +25,7 @@ Improvements
- Allow for checkboxes and radio buttons to be disabled
- Only set a paragraph's area dirty when a text change would cause it to change size
- Ensure that a panel gets notified of all relevant changes by calling OnChildAreaDirty for all grandchildren
- Avoid unnecessary panel updates by using an Epsilon comparison when scrolling children
Fixes
- Fixed paragraph links having incorrect hover locations when using special text alignments

View file

@ -120,7 +120,7 @@ namespace MLEM.Ui.Elements {
return;
var offset = new Vector2(0, -this.ScrollBar.CurrentValue);
foreach (var child in this.GetChildren(c => c != this.ScrollBar, true)) {
if (child.ScrollOffset != offset) {
if (!child.ScrollOffset.Equals(offset, Epsilon)) {
child.ScrollOffset = offset;
this.relevantChildrenDirty = true;
}