コード例 #1
0
        protected override string Render(Rectangle rectangle)
        {
            var r = rectangle.Rectangle;

            if (rectangle.Fill && rectangle.Stroke)
            {
                return($@"<rect x=""{r.X}"" y=""{r.Y}"" width=""{r.Width}"" height=""{r.Height}"" style=""fill:{ColorToHtml(FillColor)};stroke:{ColorToHtml(StrokeColor)};stroke-width:{StrokeWidth};"" />");
            }

            if (rectangle.Fill)
            {
                return($@"<rect x=""{r.X}"" y=""{r.Y}"" width=""{r.Width}"" height=""{r.Height}"" style=""fill:{ColorToHtml(FillColor)};"" />");
            }

            if (rectangle.Stroke)
            {
                return($@"<rect x=""{r.X}"" y=""{r.Y}"" width=""{r.Width}"" height=""{r.Height}"" style=""stroke:{ColorToHtml(StrokeColor)};stroke-width:{StrokeWidth};"" />");
            }

            return("");
        }
コード例 #2
0
ファイル: CodeRenderer.cs プロジェクト: Anders-H/WebGfxUnity
 protected abstract string Render(Rectangle rectangle);