Fix repeat points being scaled incorrectly (#5459)

Fix repeat points being scaled incorrectly
This commit is contained in:
Dean Herbert 2019-07-29 18:48:04 +09:00 committed by GitHub
commit afd6024ba2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 7 deletions

View File

@ -3,6 +3,8 @@
using System;
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.MathUtils;
@ -20,27 +22,40 @@ public class DrawableRepeatPoint : DrawableOsuHitObject, ITrackSnaking
private double animDuration;
private readonly SkinnableDrawable scaleContainer;
public DrawableRepeatPoint(RepeatPoint repeatPoint, DrawableSlider drawableSlider)
: base(repeatPoint)
{
this.repeatPoint = repeatPoint;
this.drawableSlider = drawableSlider;
Size = new Vector2(45 * repeatPoint.Scale);
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
Blending = BlendingMode.Additive;
Origin = Anchor.Centre;
InternalChildren = new Drawable[]
{
new SkinnableDrawable("Play/osu/reversearrow", _ => new SpriteIcon
InternalChild = scaleContainer = new SkinnableDrawable("Play/osu/reversearrow", _ => new SpriteIcon
{
RelativeSizeAxes = Axes.Both,
Icon = FontAwesome.Solid.ChevronRight
})
Icon = FontAwesome.Solid.ChevronRight,
Size = new Vector2(0.35f)
}, confineMode: ConfineMode.NoScaling)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
};
}
private readonly IBindable<float> scaleBindable = new Bindable<float>();
[BackgroundDependencyLoader]
private void load()
{
scaleBindable.BindValueChanged(scale => scaleContainer.Scale = new Vector2(scale.NewValue), true);
scaleBindable.BindTo(HitObject.ScaleBindable);
}
protected override void CheckForResult(bool userTriggered, double timeOffset)
{
if (repeatPoint.StartTime <= Time.Current)