Begin to work on matrix transformation (does not yet really work)

This commit is contained in:
legoff.laurent 2010-11-25 17:54:56 +00:00
parent 2d02464b73
commit ae9b990671

View file

@ -91,11 +91,8 @@ func (gc *GraphicContext) Rotate(angle float) {
}
func (gc *GraphicContext) Translate(tx, ty float) {
ox, oy := gc.current.path.LastPoint()
tr := NewTranslationMatrix(ox, oy)
tr2 := NewTranslationMatrix(tx, ty)
tr1 := tr.GetInverseTransformation()
gc.current.tr.Compose(tr).Compose(tr2).Compose(tr1)
tr := NewTranslationMatrix(tx, ty)
gc.current.tr.Compose(tr)
}
func (gc *GraphicContext) Scale(sx, sy float) {
@ -156,6 +153,7 @@ func (gc *GraphicContext) Save() {
context.cap = gc.current.cap
context.join = gc.current.join
context.path = gc.current.path.Copy()
copy(context.tr[:], gc.current.tr[:])
context.previous = gc.current
gc.current = context
}
@ -234,7 +232,7 @@ func (gc *GraphicContext) RArcTo(dcx, dcy, rx, ry, startAngle, angle float) {
gc.current.path.RArcTo(dcx, dcy, rx, ry, startAngle, angle)
}
func (gc *GraphicContext) Close() {
func (gc *GraphicContext) ClosePath() {
gc.current.path.Close()
}