From 23a92d222180b5c033126937bf3cbfbc6fd935f6 Mon Sep 17 00:00:00 2001 From: Thomas Friedel Date: Thu, 2 May 2019 12:23:53 +0200 Subject: [PATCH] fixed image pattern transform matrix --- images.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/images.go b/images.go index 0bc0eb3..a3770f6 100644 --- a/images.go +++ b/images.go @@ -216,10 +216,11 @@ func (ip *ImagePattern) data() backendbase.ImagePatternData { // to the given matrix. The matrix is a 3x3 matrix, but three // of the values are always identity values func (ip *ImagePattern) SetTransform(tf [6]float64) { + m := mat(tf).invert() ip.tf = [9]float64{ - tf[0], tf[1], 0, - tf[2], tf[3], 0, - tf[4], tf[5], 1, + m[0], m[2], m[4], + m[1], m[3], m[5], + 0, 0, 1, } ip.ip.Replace(ip.data()) }