public override void Draw(DrawingContext ctx) { value.Draw(ctx, 0, 0); ctx.PushTransform(new ScaleTransform(DegreeRatio, DegreeRatio, value.Width, 0)); degree.Draw(ctx, value.Width, 0); ctx.Pop(); }
public override void Draw(DrawingContext ctx) { ctx.DrawLine(LinePen, new Point(0, Height - SqrtWidth * 2 / 3), new Point(SqrtWidth * 2 / 3, Height)); ctx.DrawLine(LinePen, new Point(SqrtWidth * 2 / 3, Height), new Point(SqrtWidth, 0)); ctx.DrawLine(LinePen, new Point(SqrtWidth, 0), new Point(Width, 0)); element.Draw(ctx, SqrtWidth + Margin, Margin); }
public override void Draw(DrawingContext ctx) { double x = 0; double y = 0; int i = 0; ctx.DrawLine(LinePen, new Point(0, 0), new Point(0, Height)); ctx.DrawLine(LinePen, new Point(0, 0), new Point(BracketWidth, 0)); ctx.DrawLine(LinePen, new Point(0, Height), new Point(BracketWidth, Height)); ctx.DrawLine(LinePen, new Point(Width, 0), new Point(Width, Height)); ctx.DrawLine(LinePen, new Point(Width - BracketWidth, 0), new Point(Width, 0)); ctx.DrawLine(LinePen, new Point(Width - BracketWidth, Height), new Point(Width, Height)); for (int r = 0; r < rows; r++) { x = BracketWidth + ElementGap; for (int c = 0; c < columns; c++) { FormulaElement element = elements[i++]; element.Draw(ctx, x + (columnWidth - element.Width) / 2, y + (rowHeight - element.Height) / 2); x += columnWidth + ElementGap; } y += rowHeight + ElementGap; } }
public static Size DrawElements(DrawingContext ctx, double x, double y, int fontSize, TokenType type) { FormulaElement fe = CreateFormulaElement(type, fontSize); Size size = new Size(fe.Width, fe.Height); fe.Draw(ctx, x, y); return(size); }
public override void Draw(DrawingContext ctx) { double y = numerator.Height + 1; numerator.Draw(ctx, (Width - numerator.Width) / 2, 0); ctx.DrawLine(LinePen, new Point(0, y), new Point(Width, y)); denominator.Draw(ctx, (Width - denominator.Width) / 2, y + 3); }
public override void Draw(DrawingContext ctx) { ctx.DrawLine(LinePen, new Point(0, 0), new Point(0, Height)); ctx.DrawLine(LinePen, new Point(Width, 0), new Point(Width, Height)); element.Draw(ctx, SymbolWidth + Gap, 0); }
public override void Draw(DrawingContext ctx) { DrawBracket(ctx, 0, 0, Height, true); DrawBracket(ctx, Width - CloseBracket.Width, 0, Height, false); element.Draw(ctx, OpenBracket.Width + BracketGap, 0); }