Exemple #1
0
        private void DrawPieceCentre(RenderTreeBuilder builder, double x, double y, ref int ct, PieceColor color, string id)
        {
            builder.OpenElement(ct++, "circle");
            builder.AddAttribute(ct++, "name", id);
            builder.AddAttribute(ct++, "cx", x);
            builder.AddAttribute(ct++, "cy", y);
            builder.AddAttribute(ct++, "r", _vertexLength * .2);
            builder.AddAttribute(ct++, "fill", color.Ring);
            //adding this ring has stopped an error on render 'can't remove addtribute from non element'
            builder.AddAttribute(ct++, "stroke", color.Ring);
            builder.AddAttribute(ct++, "stroke-width", 1);

            builder.CloseElement();
        }
Exemple #2
0
 private void DrawPieceRing(RenderTreeBuilder builder, double x, double y, ref int ct, PieceColor color, string id)
 {
     builder.OpenElement(ct++, "circle");
     builder.AddAttribute(ct++, "name", id);
     builder.AddAttribute(ct++, "cx", x);
     builder.AddAttribute(ct++, "cy", y);
     builder.AddAttribute(ct++, "r", _vertexLength * .3);
     builder.AddAttribute(ct++, "fill", color.Base);
     builder.AddAttribute(ct++, "stroke", color.Ring);
     builder.AddAttribute(ct++, "stroke-width", 2);
     builder.CloseElement();
 }
Exemple #3
0
        private void DrawStackCount(RenderTreeBuilder builder, double x, double y, ref int ct, string id, int stackHeight, PieceColor color)
        {
            var x1 = x - 4;
            var y1 = y + 4;

            builder.OpenElement(ct++, "text");
            builder.AddAttribute(ct++, "x", x1);
            builder.AddAttribute(ct++, "y", y1);

            builder.AddAttribute(ct++, "style", $"fill:{color.Outer};font-size:{GetFontSize()}px");
            builder.AddContent(ct++, stackHeight);
            builder.CloseElement();
        }