mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Split out common logic into private method and add inline comment for future visitors
This commit is contained in:
parent
d9e3276d0e
commit
fbc6fb8fc5
@ -58,11 +58,13 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
{
|
{
|
||||||
this.slider = slider;
|
this.slider = slider;
|
||||||
ControlPoint = controlPoint;
|
ControlPoint = controlPoint;
|
||||||
PointsInSegment = slider.Path.PointsInSegment(ControlPoint);
|
|
||||||
|
// we don't want to run the path type update on construction as it may inadvertently change the slider.
|
||||||
|
cachePoints(slider);
|
||||||
|
|
||||||
slider.Path.Version.BindValueChanged(_ =>
|
slider.Path.Version.BindValueChanged(_ =>
|
||||||
{
|
{
|
||||||
PointsInSegment = slider.Path.PointsInSegment(ControlPoint);
|
cachePoints(slider);
|
||||||
updatePathType();
|
updatePathType();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -206,6 +208,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
|
|
||||||
protected override void OnDragEnd(DragEndEvent e) => changeHandler?.EndChange();
|
protected override void OnDragEnd(DragEndEvent e) => changeHandler?.EndChange();
|
||||||
|
|
||||||
|
private void cachePoints(Slider slider) => PointsInSegment = slider.Path.PointsInSegment(ControlPoint);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handles correction of invalid path types.
|
/// Handles correction of invalid path types.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user