mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09: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
|
public partial class TestSceneZoomableScrollContainer : OsuManualInputManagerTestScene
|
||||||
{
|
{
|
||||||
private ZoomableScrollContainer scrollContainer;
|
private TestZoomableScrollContainer scrollContainer;
|
||||||
private Drawable innerBox;
|
private Drawable innerBox;
|
||||||
|
|
||||||
[SetUpSteps]
|
[SetUpSteps]
|
||||||
@ -47,7 +47,7 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = OsuColour.Gray(30)
|
Colour = OsuColour.Gray(30)
|
||||||
},
|
},
|
||||||
scrollContainer = new ZoomableScrollContainer(1, 60, 1)
|
scrollContainer = new TestZoomableScrollContainer(1, 60, 1)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = 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);
|
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]
|
[Test]
|
||||||
public void TestZoom0()
|
public void TestZoom0()
|
||||||
{
|
{
|
||||||
@ -190,5 +198,15 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
|
|
||||||
private Quad scrollQuad => scrollContainer.ScreenSpaceDrawQuad;
|
private Quad scrollQuad => scrollContainer.ScreenSpaceDrawQuad;
|
||||||
private Quad boxQuad => innerBox.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;
|
minZoom = minimum;
|
||||||
maxZoom = maximum;
|
maxZoom = maximum;
|
||||||
CurrentZoom = zoomTarget = initial;
|
|
||||||
isZoomSetUp = true;
|
|
||||||
|
|
||||||
|
CurrentZoom = zoomTarget = initial;
|
||||||
|
zoomedContentWidthCache.Invalidate();
|
||||||
|
|
||||||
|
isZoomSetUp = true;
|
||||||
zoomedContent.Show();
|
zoomedContent.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user