From 64682611bbd547336f61e3fe7bd42594e802c7bd Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 23 Oct 2019 16:39:14 +0900 Subject: [PATCH 1/3] Fix distance snapping grid not updating on scroll --- osu.Game/Rulesets/Edit/HitObjectComposer.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Edit/HitObjectComposer.cs b/osu.Game/Rulesets/Edit/HitObjectComposer.cs index 51155ce3fd..5b8f6663e7 100644 --- a/osu.Game/Rulesets/Edit/HitObjectComposer.cs +++ b/osu.Game/Rulesets/Edit/HitObjectComposer.cs @@ -162,12 +162,17 @@ namespace osu.Game.Rulesets.Edit inputManager = GetContainingInputManager(); } + private double lastGridUpdateTime; + protected override void Update() { base.Update(); - if (EditorClock.ElapsedFrameTime != 0 && blueprintContainer.CurrentTool != null) + if (EditorClock.CurrentTime != lastGridUpdateTime && blueprintContainer.CurrentTool != null) + { showGridFor(Enumerable.Empty()); + lastGridUpdateTime = EditorClock.CurrentTime; + } } protected override void UpdateAfterChildren() @@ -212,6 +217,8 @@ namespace osu.Game.Rulesets.Edit { distanceSnapGridContainer.Child = distanceSnapGrid; distanceSnapGridContainer.Show(); + + lastGridUpdateTime = EditorClock.CurrentTime; } } From 2c9b11cdfd2b898f271147e27ae5395d926687d8 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 23 Oct 2019 17:49:21 +0900 Subject: [PATCH 2/3] Move variable outside of if block --- osu.Game/Rulesets/Edit/HitObjectComposer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Edit/HitObjectComposer.cs b/osu.Game/Rulesets/Edit/HitObjectComposer.cs index 5b8f6663e7..7e7c260360 100644 --- a/osu.Game/Rulesets/Edit/HitObjectComposer.cs +++ b/osu.Game/Rulesets/Edit/HitObjectComposer.cs @@ -217,9 +217,9 @@ namespace osu.Game.Rulesets.Edit { distanceSnapGridContainer.Child = distanceSnapGrid; distanceSnapGridContainer.Show(); - - lastGridUpdateTime = EditorClock.CurrentTime; } + + lastGridUpdateTime = EditorClock.CurrentTime; } private ScheduledDelegate scheduledUpdate; From c03fa01fd9194f66b2e8c9733546aafddabdcb5c Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 23 Oct 2019 17:51:16 +0900 Subject: [PATCH 3/3] Remove unnecessary set --- osu.Game/Rulesets/Edit/HitObjectComposer.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Game/Rulesets/Edit/HitObjectComposer.cs b/osu.Game/Rulesets/Edit/HitObjectComposer.cs index 7e7c260360..6396301add 100644 --- a/osu.Game/Rulesets/Edit/HitObjectComposer.cs +++ b/osu.Game/Rulesets/Edit/HitObjectComposer.cs @@ -169,10 +169,7 @@ namespace osu.Game.Rulesets.Edit base.Update(); if (EditorClock.CurrentTime != lastGridUpdateTime && blueprintContainer.CurrentTool != null) - { showGridFor(Enumerable.Empty()); - lastGridUpdateTime = EditorClock.CurrentTime; - } } protected override void UpdateAfterChildren()