// RepeatEnd: dots, thin, thick public override void CreateMetrics(Graphics graphics) { double leftEdgeReOriginX = (ThickStrokeWidth / 2F) - DoubleBarPadding - ThinStrokeWidth - DoubleBarPadding - _dotWidth; double rightEdgeReOriginX = (ThickStrokeWidth / 2F); BRMetrics brMetrics = new BRMetrics(leftEdgeReOriginX, rightEdgeReOriginX, CSSObjectClass.thickBarline, CSSObjectClass.thinBarline); brMetrics.SetLeft(brMetrics.Left - _dotWidth - DoubleBarPadding); RepeatTimesText timesText = null; if (_timesStr != null) { timesText = new RepeatTimesText(this, _timesStr, M.PageFormat.RepeatTimesStringFontHeight); timesText.Metrics = new TextMetrics(CSSObjectClass.repeatTimes, graphics, timesText.TextInfo); // Set the timesText's default position wrt its anchor here // (it can be moved again later using drawObject.Metrics). var width = timesText.Metrics.Right - timesText.Metrics.Left; var deltaX = brMetrics.OriginX - (width * 0.6); var deltaY = brMetrics.Top - timesText.Metrics.Bottom - Gap; timesText.Metrics.Move(deltaX, deltaY); this.DrawObjects.Add(timesText); } // Note that the AnchorMetrics are used for both horizontal and vertical collision checking. Metrics = new AnchorMetrics(brMetrics, DrawObjects); }
public override void CreateMetrics(Graphics graphics) { double rightEdge = (ThickStrokeWidth / 2F) + DoubleBarPadding + ThinStrokeWidth; double leftEdge = -rightEdge; Metrics = new BRMetrics(leftEdge, rightEdge, CSSObjectClass.thinBarline, CSSObjectClass.thickBarline); SetCommonMetrics(graphics, DrawObjects); foreach (DrawObject drawObject in DrawObjects) { if (drawObject is FramedRegionStartText frst) { FramedRegionStartTextMetrics = new FramedRegionInfoMetrics(graphics, frst.Texts, frst.FrameInfo, Gap); if (RegionFrameConnectorMetrics == null) { RegionFrameConnectorMetrics = new RegionFrameConnectorMetrics(Metrics.OriginX, frst.FrameInfo.Bottom, Metrics.Top); } } if (drawObject is FramedRegionEndText fret) { FramedRegionEndTextMetrics = new FramedRegionInfoMetrics(graphics, fret.Texts, fret.FrameInfo, Gap); } } }
// EndOfScoreBarline: thin, thick public override void CreateMetrics(Graphics graphics) { double rightEdgeReOriginX = (ThickStrokeWidth / 2F); double leftEdgeReOriginX = -DoubleBarPadding - (ThickStrokeWidth / 2) - (ThinStrokeWidth / 2); Metrics = new BRMetrics(leftEdgeReOriginX, rightEdgeReOriginX, CSSObjectClass.thickBarline, CSSObjectClass.thinBarline); }
// RepeatBegin: thick, thin, dots public override void CreateMetrics(Graphics graphics) { double leftEdgeReOriginX = -DoubleBarPadding; double rightEdgeReOriginX = DoubleBarPadding + ThinStrokeWidth; Metrics = new BRMetrics(leftEdgeReOriginX, rightEdgeReOriginX, CSSObjectClass.thinBarline, CSSObjectClass.thickBarline); ((BRMetrics)Metrics).SetRight(Metrics.Right + DoubleBarPadding + _dotWidth); }
// The following functions are inherited from EndRegionBarline. // public override void WriteDrawObjectsSVG(SvgWriter w) // public override void AddMetricsToEdge(HorizontalEdge horizontalEdge) // internal override void AlignFramedTextsXY(List<NoteObject> fixedNoteObjects) // internal override void AddAncilliaryMetricsTo(StaffMetrics staffMetrics) public override void CreateMetrics(Graphics graphics) { double leftEdge = -((ThickStrokeWidth / 2F) + DoubleBarPadding + NormalStrokeWidth); double rightEdge = (ThickStrokeWidth / 2F); Metrics = new BRMetrics(leftEdge, rightEdge, CSSObjectClass.thinBarline, CSSObjectClass.thickBarline); foreach (DrawObject drawObject in DrawObjects) { if (drawObject is FramedRegionEndText frst) { FramedRegionEndTextMetrics = new FramedRegionInfoMetrics(graphics, frst.Texts, frst.FrameInfo, Gap); break; } } }
public override void CreateMetrics(Graphics graphics) { Metrics = new BRMetrics(-(NormalStrokeWidth / 2F), (NormalStrokeWidth / 2F)); SetCommonMetrics(graphics, DrawObjects); }