示例#1
0
文件: Barline.cs 项目: notator/Moritz
        /// <summary>
        /// Writes out an SVG Barline.
        /// May be called twice per staff.barline:
        ///     1. for the range between top and bottom stafflines (if Barline.Visible is true)
        ///     2. for the range between the staff's lower edge and the next staff's upper edge
        ///        (if the staff's lower neighbour is in the same group)
        /// </summary>
        /// <param name="w"></param>
        public void WriteSVG(SvgWriter w, float topStafflineY, float bottomStafflineY, float singleBarlineStrokeWidth, float stafflineStrokeWidth, bool isLastNoteObject, bool isConnector)
        {
            float topY = topStafflineY;
            float bottomY = bottomStafflineY;
            if(isLastNoteObject && !isConnector)
            {
                float halfStrokeWidth = (stafflineStrokeWidth / 2);
                topY -= halfStrokeWidth;
                bottomY += halfStrokeWidth;
            }

            string barlineType;
            if(BarlineType == BarlineType.end)
            {
                barlineType = isConnector ? null : "endBarlineLeft";
                w.SvgLine(barlineType,
                    this.Metrics.OriginX - (singleBarlineStrokeWidth * 3F), topY,
                    this.Metrics.OriginX - (singleBarlineStrokeWidth * 3F), bottomY,
                    "black", singleBarlineStrokeWidth, null);

                barlineType = isConnector ? null : "endBarlineRight";
                w.SvgLine(barlineType,
                    this.Metrics.OriginX, topY,
                    this.Metrics.OriginX, bottomY,
                    "black", singleBarlineStrokeWidth * 2F, null);
            }
            else
            {
                barlineType = isConnector ? null : "barline";
                w.SvgLine(barlineType, this.Metrics.OriginX, topY, this.Metrics.OriginX, bottomY, "black", singleBarlineStrokeWidth, null);
            }
        }
示例#2
0
文件: Metrics.cs 项目: notator/Moritz
 public override void WriteSVG(SvgWriter w)
 {
     w.SvgLine(null, _originX, _top, _originX, _bottom, "black", StrokeWidth, "round");
 }
示例#3
0
文件: Metrics.cs 项目: notator/Moritz
 public override void WriteSVG(SvgWriter w)
 {
     if(_drawExtender)
         w.SvgLine(null, _left, _originY, _right, _originY, _colorAttribute, _strokeWidth, "butt");
 }
示例#4
0
文件: Metrics.cs 项目: notator/Moritz
 public override void WriteSVG(SvgWriter w)
 {
     foreach(float y in Ys)
     {
         w.SvgLine(null, _left + _strokeWidth, y, _right - _strokeWidth, y, "black", _strokeWidth, null);
     }
 }
示例#5
0
 public override void WriteSVG(SvgWriter w)
 {
     w.SvgLine("stem" + SvgScore.UniqueID_Number, _originX, _top, _originX, _bottom, "black", StrokeWidth, "round");
 }
示例#6
0
 public override void WriteSVG(SvgWriter w)
 {
     if(_drawExtender)
         w.SvgLine("extender" + SvgScore.UniqueID_Number, _left, _originY, _right, _originY, "black", _strokeWidth, "butt");
 }
示例#7
0
 public override void WriteSVG(SvgWriter w)
 {
     foreach(float y in Ys)
     {
         w.SvgLine("ledger" + SvgScore.UniqueID_Number, _left + _strokeWidth, y, _right - _strokeWidth, y, "black", _strokeWidth, null);
     }
 }