[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: [Issue N9102]  Qt3.1 beta 1 breaks QWMatrix
From:       qt-bugs () trolltech ! com
Date:       2002-10-21 14:26:39
[Download RAW message or body]

On Sunday, 20 Oct 2002 20:47 Lenny wrote:
> Hi,
>
> I see no obvious way anymore in Qt 3.1 to translate something, rotate
> it
> and translate it back.
>
> The code to blame in qwmatrix.h:
>
> QWMatrix &QWMatrix::translate( double dx, double dy )
> {
>      _dx += dx*_m11;
>      _dy += dy*_m22;
>      return *this;
> }
>
> You cannot translate back, because the matrix diagonal elements are !=
> 1after
> a non trivial rotation.

Hi Lenny,

you're right. Thanks a lot for the report. The change below should fix
the problem.

Cheers,
Lars

@@ -802,8 +802,8 @@

 QWMatrix &QWMatrix::translate( double dx, double dy )
 {
-    _dx += dx*_m11;
-    _dy += dy*_m22;
+    _dx += dx*_m11 + dy*_m21;
+    _dy += dy*_m22 + dx*_m12;
     return *this;
 }


--
Lars Knoll, Software Engineer
Trolltech AS, Waldemar Thranes gt. 98, N-0175 Oslo, Norway

_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic