public void SetRange(double p0, double p1) { if (p0 > p1) { MathHelper.Swap(ref p0, ref p1); } if (updateSnaking(p0, p1)) { // The path is generated such that its size encloses it. This change of size causes the path // to move around while snaking, so we need to offset it to make sure it maintains the // same position as when it is fully snaked. var newTopLeftOffset = path.PositionInBoundingBox(Vector2.Zero); path.Position = topLeftOffset - newTopLeftOffset; container.ForceRedraw(); } }
protected override void Update() { base.Update(); if (updateSnaking()) { // Autosizing does not give us the desired behaviour here. // We want the container to have the same size as the slider, // and to be positioned such that the slider head is at (0,0). container.Size = path.Size; container.Position = -path.HeadPosition; container.ForceRedraw(); } }
/// <summary> /// 設定Slider顯示範圍 /// </summary> /// <param name="p0"></param> /// <param name="p1"></param> public void SetRange(List <Vector2> currentCurve) { //如果可以顯示 if (updateSnaking(currentCurve)) { // Autosizing does not give us the desired behaviour here. // We want the container to have the same size as the slider, // and to be positioned such that the slider head is at (0,0). container.Size = path.Size; //修正顯示座標 //container.Position = -path.PositionInBoundingBox(slider.Curve.PositionAt(0) - currentCurve[0]); container.Position = -new Vector2(PathWidth, PathWidth); container.ForceRedraw(); } }
private void newPoints() { path.ClearVertices(); var ps = new osu.Game.Rulesets.Objects.BezierApproximator(points).CreateBezier(); foreach (var point in ps) { path.AddVertex(point); } container.Size = path.Size; points.RemoveAt(0); container.ForceRedraw(); if (points.Count == 1) { populatePoints(); } }
public void SetRange(double p0, double p1) { if (p0 > p1) { MathHelper.Swap(ref p0, ref p1); } if (updateSnaking(p0, p1)) { // Autosizing does not give us the desired behaviour here. // We want the container to have the same size as the slider, // and to be positioned such that the slider head is at (0,0). container.Size = path.Size; container.Position = -path.PositionInBoundingBox(slider.Curve.PositionAt(0) - currentCurve[0]); container.ForceRedraw(); } }
protected override void Update() { base.Update(); if (!subtractionCache.IsValid) { subtractionLayer.Width = 5; subtractionLayer.Height = Math.Max(0, DrawHeight - DrawWidth); subtractionLayer.EdgeEffect = new EdgeEffectParameters { Colour = Color4.White, Type = EdgeEffectType.Glow, Radius = DrawWidth }; foreground.ForceRedraw(); subtractionContainer.ForceRedraw(); subtractionCache.Validate(); } }