another transformation bugfix
This commit is contained in:
parent
41a0ed18af
commit
287ff8905f
1 changed files with 13 additions and 3 deletions
16
paths.go
16
paths.go
|
@ -107,10 +107,20 @@ func (cv *Canvas) strokeTris(path *Path2D, inv mat, doInv bool, target [][2]floa
|
||||||
}
|
}
|
||||||
|
|
||||||
if doInv {
|
if doInv {
|
||||||
for i, pt := range path.p {
|
pcopy := *path
|
||||||
path.p[i].pos = pt.pos.mulMat(inv)
|
var pbuf [50]pathPoint
|
||||||
path.p[i].next = pt.next.mulMat(inv)
|
if len(path.p) <= len(pbuf) {
|
||||||
|
pcopy.p = pbuf[:len(path.p)]
|
||||||
|
} else {
|
||||||
|
pcopy.p = make([]pathPoint, len(path.p))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for i, pt := range path.p {
|
||||||
|
pt.pos = pt.pos.mulMat(inv)
|
||||||
|
pt.next = pt.next.mulMat(inv)
|
||||||
|
pcopy.p[i] = pt
|
||||||
|
}
|
||||||
|
path = &pcopy
|
||||||
}
|
}
|
||||||
|
|
||||||
dashedPath := cv.applyLineDash(path.p)
|
dashedPath := cv.applyLineDash(path.p)
|
||||||
|
|
Loading…
Reference in a new issue