AW: Consider translation of transformation matrix of image rotation
Armin Le Grand
Armin.LeGrand at extern.cib.de
Fri Feb 23 15:39:23 UTC 2018
Hi Regina,
> It works in principle,
What does that mean ?!?
A: An empty constructed basegfx::B2DHomMatrix is on identity (no-op), so it is ideal to test if it is used. Will even work when usages add-up to identity matrix whant means 'no change'. Yes, use isIdentity() please.
B: You might calculate it, but it is not really needed. Since we rotate arouhd center (only) it is sufficient to extract rotation and set it - we know it's around center. The rest of the shape (svg:x/y/width/height) is the unrotated shape, so this is sufficient. It can be calculated to make error-checks if wanted. It will have to be calculated when someone will use more of the transformation later (or we do)
C: Not sure whant you mean here. Correcting the position means it's 'overdefined'. The (svg:x/y/width/height) and back-calculating from transformation with (-translate, rotate, translate) to rotate around center *should* always give the same center. If not, it is *not clear* which definition is the correct one. This is the reason the transformation should *not* contain positioning at all. The idea is: Apply (svg:x/y/width/height) first (pos and size), then apply transformation to it (rotate, shear, mirror (scale-1)).
HTH!
-----Ursprüngliche Nachricht-----
Von: Regina Henschel [mailto:rb.henschel at t-online.de]
Gesendet: Friday, February 23, 2018 15:13
An: LO dev fdo <libreoffice at lists.freedesktop.org>
Cc: Armin Le Grand <Armin.LeGrand at extern.cib.de>
Betreff: Consider translation of transformation matrix of image rotation
Hi Armin, hi all,
this is about https://bugs.documentfoundation.org/show_bug.cgi?id=115590
and my proposal https://gerrit.libreoffice.org/#/c/50176/
It works in principle, but I'm not sure about some details:
A
It has a construction
basegfx::B2DHomMatrix aFullTransform;
with later on
if ( !aFullTransform.isIdentity() )
Should I use
basegfx::B2DHomMatrix aFullTransform;
bool bHasTransformation;
if ( bHasTransformation )
instead?
B
It has
if ( aTransformedCenterPosition != aCenterPosition ) Is this check useful, or should I calculate the correction always, although the result might be the original value?
C
Is this the correct place at all to correct the position?
Kind regards
Regina
More information about the LibreOffice
mailing list