mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 12:58:33 +01:00
Avoid unnecessary panel updates by using an Epsilon comparison when scrolling children
This commit is contained in:
parent
c28f6d858c
commit
80a6c6b5e2
2 changed files with 2 additions and 1 deletions
|
@ -25,6 +25,7 @@ Improvements
|
||||||
- Allow for checkboxes and radio buttons to be disabled
|
- 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
|
- 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
|
- 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
|
Fixes
|
||||||
- Fixed paragraph links having incorrect hover locations when using special text alignments
|
- Fixed paragraph links having incorrect hover locations when using special text alignments
|
||||||
|
|
|
@ -120,7 +120,7 @@ namespace MLEM.Ui.Elements {
|
||||||
return;
|
return;
|
||||||
var offset = new Vector2(0, -this.ScrollBar.CurrentValue);
|
var offset = new Vector2(0, -this.ScrollBar.CurrentValue);
|
||||||
foreach (var child in this.GetChildren(c => c != this.ScrollBar, true)) {
|
foreach (var child in this.GetChildren(c => c != this.ScrollBar, true)) {
|
||||||
if (child.ScrollOffset != offset) {
|
if (!child.ScrollOffset.Equals(offset, Epsilon)) {
|
||||||
child.ScrollOffset = offset;
|
child.ScrollOffset = offset;
|
||||||
this.relevantChildrenDirty = true;
|
this.relevantChildrenDirty = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue