/** * Create a new Graphic context from an image */ func NewStackGraphicContext() *StackGraphicContext { gc := &StackGraphicContext{} gc.Current = new(ContextStack) gc.Current.Tr = draw2d.NewIdentityMatrix() gc.Current.Path = new(draw2d.Path) gc.Current.LineWidth = 1.0 gc.Current.StrokeColor = image.Black gc.Current.FillColor = image.White gc.Current.Cap = draw2d.RoundCap gc.Current.FillRule = draw2d.FillRuleEvenOdd gc.Current.Join = draw2d.RoundJoin gc.Current.FontSize = 10 gc.Current.FontData = DefaultFontData return gc }
func defaultmatrix(interpreter *Interpreter) { tr := interpreter.Pop().(draw2d.Matrix) ident := draw2d.NewIdentityMatrix() copy(tr[:], ident[:]) interpreter.Push(tr) }
func initmatrix(interpreter *Interpreter) { interpreter.Push(draw2d.NewIdentityMatrix()) }