[Kst] extragear/graphics/kst/src/libkstapp

Andrew Walker arwalker at sumusltd.com
Tue Aug 1 18:41:33 CEST 2006


Calling normalize on a QRect that (for example) has a left value of 399 and
a width of -399 results in a QRect with a left value of -1 and a width of
401.
Clearly incorrect, and this is what the code fixes.

-----Original Message-----
From: George Staikos [mailto:staikos at kde.org]
Sent: July 31, 2006 3:57 PM
To: kst at kde.org
Subject: Re: [Kst] extragear/graphics/kst/src/libkstapp



Hi Andrew,

Could you please explain this patch and what exactly was wrong, and why this
is the right fix?

Thanks

Quoting Andrew Walker <arwalker at sumusltd.com>:

> SVN commit 568394 by arwalker:
>
> BUG:131625 Correctly normalize the new QRect
>
>  M  +11 -0     kstgfxmousehandlerutils.cpp
>
>
> --- trunk/extragear/graphics/kst/src/libkstapp/kstgfxmousehandlerutils.cpp
> #568393:568394
> @@ -152,6 +152,17 @@
>        newSize.setRight(anchorPoint.x() - int(newHalfWidth));
>      }
>
> +  if (newSize.width() < 0) {
> +    int width = newSize.width();
> +    newSize.setLeft(newSize.left() + width);
> +    newSize.setRight(width * -1);
> +  }
> +  if (newSize.height() < 0) {
> +    int height = newSize.height();
> +    newSize.setTop(newSize.top() + height);
> +    newSize.setHeight(height * -1);
> +  }
> +
>      newSize = newSize.normalize();
>
>      return newSize;
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst
>
>


--
George Staikos

_______________________________________________
Kst mailing list
Kst at kde.org
https://mail.kde.org/mailman/listinfo/kst



More information about the Kst mailing list