public static void DrawHoldLine(RenderParams renderParams, Note startNote, Note endNote, Pen pen) { var graphics = renderParams.Graphics; var now = renderParams.Now; OnStageStatus s1 = GetNoteOnStageStatus(startNote, now), s2 = GetNoteOnStageStatus(endNote, now); if (s1 == s2 && s1 != OnStageStatus.OnStage) { return; } float t1 = GetNoteTransformedTime(renderParams, startNote, true, true); float t2 = GetNoteTransformedTime(renderParams, endNote, true, true); float tmid = (t1 + t2) * 0.5f; float x1 = GetNoteXPosition(renderParams, startNote.FinishPosition, startNote.StartPosition, t1); float x2 = GetNoteXPosition(renderParams, endNote.FinishPosition, endNote.StartPosition, t2); float xmid = GetNoteXPosition(renderParams, endNote.FinishPosition, endNote.StartPosition, tmid); float y1 = GetNoteYPosition(renderParams, t1); float y2 = GetNoteYPosition(renderParams, t2); float ymid = GetNoteYPosition(renderParams, tmid); float xcontrol1, xcontrol2, ycontrol1, ycontrol2; GetBezierFromQuadratic(x1, xmid, x2, out xcontrol1, out xcontrol2); GetBezierFromQuadratic(y1, ymid, y2, out ycontrol1, out ycontrol2); graphics.DrawBezier(pen, x1, y1, xcontrol1, ycontrol1, xcontrol2, ycontrol2, x2, y2); }
private void DrawHoldRibbon(RenderContext context, double now, Note startNote, Note endNote) { OnStageStatus s1 = NotesLayerUtils.GetNoteOnStageStatus(startNote, now), s2 = NotesLayerUtils.GetNoteOnStageStatus(endNote, now); if (s1 == s2 && s1 != OnStageStatus.OnStage) { return; } var mesh = new RibbonMesh(context, startNote, endNote, now, ConnectionType.Hold); mesh.Fill(RibbonBrush.Brush); }
private void DrawHoldRibbon(Graphics context, double now, Note startNote, Note endNote) { OnStageStatus s1 = NotesLayerUtils.GetNoteOnStageStatus(startNote, now), s2 = NotesLayerUtils.GetNoteOnStageStatus(endNote, now); if (s1 == s2 && s1 != OnStageStatus.OnStage) { return; } var mesh = new HoldRibbonMesh(context, startNote, endNote, now); mesh.Initialize(); mesh.Fill(_ribbonBrush); }
public static void DrawSimpleLine(RenderParams renderParams, Note startNote, Note endNote, Pen pen) { var graphics = renderParams.Graphics; var now = renderParams.Now; OnStageStatus s1 = GetNoteOnStageStatus(startNote, now), s2 = GetNoteOnStageStatus(endNote, now); if (s1 != OnStageStatus.OnStage && s2 != OnStageStatus.OnStage && s1 == s2) { return; } float x1, x2, y1, y2; GetNotePairPositions(renderParams, startNote, endNote, out x1, out x2, out y1, out y2); graphics.DrawLine(pen, x1, y1, x2, y2); }