Date: prev next · Thread: first prev next last
2019 Archives by date, by thread · List index


Hi all,

Regina Henschel schrieb am 05-Nov-19 um 13:42:

And I have found a comment in SdrObj
/// SetSnapRect() tries to size the Object so that it fits into the
/// passed Rect (without stroke width, ...)

The longer I think about it, the more I get convinced that I really have to change SdrObjCustomShape::SetSnapRect() so that the input parameter is used as snap rectangle. This means that some math is required in case of rotation and shear.

After some math, it turns out, that "fits into the passed Rect" is not possible in all cases, if we want to keep rotation and shear angle. With 'width' and 'height' of the passed rectangle and 'rot' the rotation angle of the custom shape, a suitable logical rectangle does not exists, if 'rot' is between arctan(width/height) and arctan(height/width).

Keeping rotation and shear angle is needed in case of SetVerticalWriting() and Undo(). For FitToCellSize() the current behavior is questionable for other kind of rotated shapes too and specification of the desired behavior is needed.

So my suggestion would be now, to keep SdrObjCustomShape::SetSnapRect() to use the passed rectangle as logical rectangle and change all callers so, that they pass a suitable rectangle.

Kind regards
Regina

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.