fixed image pattern transform matrix
This commit is contained in:
parent
9b7322ff16
commit
23a92d2221
1 changed files with 4 additions and 3 deletions
|
@ -216,10 +216,11 @@ func (ip *ImagePattern) data() backendbase.ImagePatternData {
|
||||||
// to the given matrix. The matrix is a 3x3 matrix, but three
|
// to the given matrix. The matrix is a 3x3 matrix, but three
|
||||||
// of the values are always identity values
|
// of the values are always identity values
|
||||||
func (ip *ImagePattern) SetTransform(tf [6]float64) {
|
func (ip *ImagePattern) SetTransform(tf [6]float64) {
|
||||||
|
m := mat(tf).invert()
|
||||||
ip.tf = [9]float64{
|
ip.tf = [9]float64{
|
||||||
tf[0], tf[1], 0,
|
m[0], m[2], m[4],
|
||||||
tf[2], tf[3], 0,
|
m[1], m[3], m[5],
|
||||||
tf[4], tf[5], 1,
|
0, 0, 1,
|
||||||
}
|
}
|
||||||
ip.ip.Replace(ip.data())
|
ip.ip.Replace(ip.data())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue