On Tuesday, April 16, 2013 08:17:16 PM Adam Reichold wrote: > Hello Fabio, > > Am 16.04.2013 19:50, schrieb Fabio D'Urso: > > FabioOn Sunday, April 07, 2013 08:10:32 PM D'Urso wrote: > >> Modified patches attached. They are not final yet: I still have > >> to update the documentation in the second-to-last patch. > > > > Final patches attached. Adam, can you have a look at 0006 and check > > if the documentation on FixedRotation is clear enough? > > First of all, sorry for not posting anything on the rendering API yet, > despite your previous patch set. I hope to get something done on the > weekend. > > I had a look at patch #6 and I think the documentation is rather helpful. > > One thing I noticed in patch #5 is that you could maybe reuse MTX in > fillTransformationMTX, i.e. always call "fillNormalizationMTX( MTX, > pageRotate );" first and modify MTX using the QTransform if necessary > instead of first creating MTXnorm on the stack.
Yes, thanks. Patch attached (to be applied on top of the others). -- Fabio
>From 77a6630689108d19939b07bb4981003cbad8b7aa Mon Sep 17 00:00:00 2001 From: Fabio D'Urso <[email protected]> Date: Sun, 2 Jun 2013 17:29:10 +0200 Subject: [PATCH] Save a little stack --- qt4/src/poppler-annotation.cc | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/qt4/src/poppler-annotation.cc b/qt4/src/poppler-annotation.cc index 3edcbdb..dbdac66 100644 --- a/qt4/src/poppler-annotation.cc +++ b/qt4/src/poppler-annotation.cc @@ -238,24 +238,16 @@ void AnnotationPrivate::fillTransformationMTX(double MTX[6]) const Q_ASSERT ( pdfAnnot ); const int pageRotate = pdfPage->getRotate(); + fillNormalizationMTX( MTX, pageRotate ); - if ( pageRotate == 0 || ( pdfAnnot->getFlags() & Annot::flagNoRotate ) == 0 ) - { - // Use the normalization matrix for this page's rotation - fillNormalizationMTX( MTX, pageRotate ); - } - else + // Clients expect coordinates relative to this page's rotation, but + // FixedRotation annotations internally use unrotated coordinates: + // construct matrix to both normalize and rotate coordinates using the + // top-left corner as rotation pivot + if ( pageRotate != 0 && ( pdfAnnot->getFlags() & Annot::flagNoRotate ) ) { - // Clients expect coordinates relative to this page's rotation, but - // FixedRotation annotations internally use unrotated coordinates: - // construct matrix to both normalize and rotate coordinates using the - // top-left corner as rotation pivot - - double MTXnorm[6]; - fillNormalizationMTX( MTXnorm, pageRotate ); - - QTransform transform( MTXnorm[0], MTXnorm[1], MTXnorm[2], - MTXnorm[3], MTXnorm[4], MTXnorm[5] ); + QTransform transform( MTX[0], MTX[1], MTX[2], + MTX[3], MTX[4], MTX[5] ); transform.translate( +pdfAnnot->getXMin(), +pdfAnnot->getYMax() ); transform.rotate( pageRotate ); transform.translate( -pdfAnnot->getXMin(), -pdfAnnot->getYMax() ); -- 1.8.1.4
_______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
