Fix curve editor panning to be stable

This commit is contained in:
Wojtek Figat
2024-11-30 23:20:57 +01:00
parent 77184c7b52
commit 44d96ad100
2 changed files with 17 additions and 6 deletions

View File

@@ -263,15 +263,21 @@ namespace FlaxEngine.GUI
/// <inheritdoc />
protected override void SetViewOffset(ref Float2 value)
{
// Update scroll bars but with locked layout
bool wasLocked = _isLayoutLocked;
int layoutUpdateLock = _layoutUpdateLock;
_isLayoutLocked = true;
_layoutUpdateLock = 999;
if (HScrollBar != null)
HScrollBar.TargetValue = -value.X;
if (VScrollBar != null)
VScrollBar.TargetValue = -value.Y;
_layoutUpdateLock = layoutUpdateLock;
_isLayoutLocked = wasLocked;
base.SetViewOffset(ref value);
PerformLayout();
}
/// <summary>