mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 20:12:57 +08:00
Add draw size invalidation to ZoomableScrollContainer
This commit is contained in:
parent
7a0320d39e
commit
6502e26d09
@ -92,13 +92,6 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
|
||||||
{
|
|
||||||
base.Update();
|
|
||||||
|
|
||||||
zoomedContent.Width = DrawWidth * currentZoom;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool OnScroll(ScrollEvent e)
|
protected override bool OnScroll(ScrollEvent e)
|
||||||
{
|
{
|
||||||
if (e.IsPrecise)
|
if (e.IsPrecise)
|
||||||
@ -169,6 +162,11 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
float targetOffset = expectedWidth * (focusPoint / contentSize) - focusOffset;
|
float targetOffset = expectedWidth * (focusPoint / contentSize) - focusOffset;
|
||||||
|
|
||||||
d.currentZoom = newZoom;
|
d.currentZoom = newZoom;
|
||||||
|
|
||||||
|
d.zoomedContent.Width = d.DrawWidth * d.currentZoom;
|
||||||
|
// Temporarily here to make sure ScrollTo gets the correct DrawSize for scrollable area.
|
||||||
|
// TODO: Make sure draw size gets invalidated properly on the framework side, and remove this once it is.
|
||||||
|
d.Invalidate(Invalidation.DrawSize);
|
||||||
d.ScrollTo(targetOffset, false);
|
d.ScrollTo(targetOffset, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user