mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 17:53:15 +08:00
Merge pull request #20258 from peppy/fix-slider-leak-editor
Fix bindable event binds to `HitObject` directly
This commit is contained in:
commit
7f291552c7
@ -6,6 +6,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
@ -53,6 +54,9 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
private IBindable<Vector2> sliderPosition;
|
private IBindable<Vector2> sliderPosition;
|
||||||
private IBindable<float> sliderScale;
|
private IBindable<float> sliderScale;
|
||||||
|
|
||||||
|
[UsedImplicitly]
|
||||||
|
private readonly IBindable<int> sliderVersion;
|
||||||
|
|
||||||
public PathControlPointPiece(Slider slider, PathControlPoint controlPoint)
|
public PathControlPointPiece(Slider slider, PathControlPoint controlPoint)
|
||||||
{
|
{
|
||||||
this.slider = slider;
|
this.slider = slider;
|
||||||
@ -61,7 +65,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
// we don't want to run the path type update on construction as it may inadvertently change the slider.
|
// we don't want to run the path type update on construction as it may inadvertently change the slider.
|
||||||
cachePoints(slider);
|
cachePoints(slider);
|
||||||
|
|
||||||
slider.Path.Version.BindValueChanged(_ =>
|
sliderVersion = slider.Path.Version.GetBoundCopy();
|
||||||
|
sliderVersion.BindValueChanged(_ =>
|
||||||
{
|
{
|
||||||
cachePoints(slider);
|
cachePoints(slider);
|
||||||
updatePathType();
|
updatePathType();
|
||||||
|
Loading…
Reference in New Issue
Block a user