Review Request 109140: Prevent infinte recursion in PictureShape/SelectionRect due to floating-point errors

Arjen Hiemstra djfreestyler at gmail.com
Mon Feb 25 12:14:49 GMT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/109140/
-----------------------------------------------------------

Review request for Calligra.


Description
-------

SelectionRect::fixAspect recurses when the values of the rect don't exceed those of the borders. However, this can cause an infinite recursion when floating point errors occur, due to (for example) rect.top() being 10.0000000001 which is larger than 10. This patch uses qFuzzyCompare to check for minor floating point errors before recursing.


Diffs
-----

  plugins/pictureshape/SelectionRect.cpp c3a9a2d 

Diff: http://git.reviewboard.kde.org/r/109140/diff/


Testing
-------

Compiled and run. Cropping on image rect still works.


Thanks,

Arjen Hiemstra

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20130225/ff9e3f64/attachment.htm>


More information about the calligra-devel mailing list