예제 #1
0
        // 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);
        }
예제 #2
0
파일: Barline.cs 프로젝트: notator/MNXtoSVG
        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);
                }
            }
        }
예제 #3
0
파일: Barline.cs 프로젝트: notator/MNXtoSVG
        // 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);
        }
예제 #4
0
        // 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);
        }
예제 #5
0
파일: Barline.cs 프로젝트: notator/MNXtoSVG
        // 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;
                }
            }
        }
예제 #6
0
파일: Barline.cs 프로젝트: notator/MNXtoSVG
 public override void CreateMetrics(Graphics graphics)
 {
     Metrics = new BRMetrics(-(NormalStrokeWidth / 2F), (NormalStrokeWidth / 2F));
     SetCommonMetrics(graphics, DrawObjects);
 }