示例#1
0
/**
 * 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
}
示例#2
0
func defaultmatrix(interpreter *Interpreter) {
	tr := interpreter.Pop().(draw2d.Matrix)
	ident := draw2d.NewIdentityMatrix()
	copy(tr[:], ident[:])
	interpreter.Push(tr)
}
示例#3
0
func initmatrix(interpreter *Interpreter) {
	interpreter.Push(draw2d.NewIdentityMatrix())
}