mirror of
https://github.com/ppy/osu
synced 2025-02-06 13:22:14 +00:00
Merge pull request #21766 from frenzibyte/fix-waveform-zoom-reload
Fix track changes not updating initial timeline zoom correctly
This commit is contained in:
commit
b1232a7ee7
@ -23,7 +23,7 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
{
|
||||
public partial class TestSceneZoomableScrollContainer : OsuManualInputManagerTestScene
|
||||
{
|
||||
private ZoomableScrollContainer scrollContainer;
|
||||
private TestZoomableScrollContainer scrollContainer;
|
||||
private Drawable innerBox;
|
||||
|
||||
[SetUpSteps]
|
||||
@ -47,7 +47,7 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = OsuColour.Gray(30)
|
||||
},
|
||||
scrollContainer = new ZoomableScrollContainer(1, 60, 1)
|
||||
scrollContainer = new TestZoomableScrollContainer(1, 60, 1)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
@ -93,6 +93,14 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
AddAssert("Inner container width matches scroll container", () => innerBox.DrawWidth == scrollContainer.DrawWidth);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestWidthUpdatesOnSecondZoomSetup()
|
||||
{
|
||||
AddAssert("Inner container width = 1x", () => innerBox.DrawWidth == scrollContainer.DrawWidth);
|
||||
AddStep("reload zoom", () => scrollContainer.SetupZoom(10, 10, 60));
|
||||
AddAssert("Inner container width = 10x", () => innerBox.DrawWidth == scrollContainer.DrawWidth * 10);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestZoom0()
|
||||
{
|
||||
@ -190,5 +198,15 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
|
||||
private Quad scrollQuad => scrollContainer.ScreenSpaceDrawQuad;
|
||||
private Quad boxQuad => innerBox.ScreenSpaceDrawQuad;
|
||||
|
||||
private partial class TestZoomableScrollContainer : ZoomableScrollContainer
|
||||
{
|
||||
public TestZoomableScrollContainer(int minimum, float maximum, float initial)
|
||||
: base(minimum, maximum, initial)
|
||||
{
|
||||
}
|
||||
|
||||
public new void SetupZoom(float initial, float minimum, float maximum) => base.SetupZoom(initial, minimum, maximum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,9 +99,11 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
|
||||
minZoom = minimum;
|
||||
maxZoom = maximum;
|
||||
CurrentZoom = zoomTarget = initial;
|
||||
isZoomSetUp = true;
|
||||
|
||||
CurrentZoom = zoomTarget = initial;
|
||||
zoomedContentWidthCache.Invalidate();
|
||||
|
||||
isZoomSetUp = true;
|
||||
zoomedContent.Show();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user