r14860 by fschmid - Fixed Bug #8812: "Suggestion: Implement an Image Frame Control to allow image movement separate from frame"

scribus-commit scribus-commit at lists.scribus.net
Tue Mar 9 13:10:17 CET 2010


Revision: 14860
Author: fschmid
Date: 2010-03-09T12:07:39.334551Z
Commit message: Fixed Bug #8812: "Suggestion: Implement an Image Frame Control to allow image movement separate from frame"

Changeset: 
M  /trunk/Scribus/scribus/canvasmode_edit.cpp

Diffs:
Index: scribus/canvasmode_edit.cpp
===================================================================
--- scribus/canvasmode_edit.cpp	(revision 14859)
+++ scribus/canvasmode_edit.cpp	(revision 14860)
@@ -96,6 +96,36 @@
 		PageItem_TextFrame* textframe = currItem->asTextFrame();
 		if (textframe)
 			drawTextCursor(p, textframe);
+		else if (currItem->asImageFrame())
+		{
+			p->save();
+			p->translate(currItem->xPos(), currItem->yPos());
+			p->rotate(currItem->rotation());
+			p->setPen(QPen(Qt::blue, 1.0 / m_canvas->scale(), Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
+			p->setClipRect(QRectF(0.0, 0.0, currItem->width(), currItem->height()));
+			p->setBrush(QColor(0,0,255,10));
+			p->setRenderHint(QPainter::Antialiasing);
+			if (currItem->imageFlippedH())
+			{
+				p->translate(currItem->width(), 0);
+				p->scale(-1, 1);
+			}
+			if (currItem->imageFlippedV())
+			{
+				p->translate(0, currItem->height());
+				p->scale(1, -1);
+			}
+			p->translate(currItem->imageXOffset()*currItem->imageXScale(), currItem->imageYOffset()*currItem->imageYScale());
+			p->drawRect(0, 0, currItem->pixm.qImagePtr()->width(), currItem->pixm.qImagePtr()->height());
+			p->translate(currItem->pixm.qImagePtr()->width() / 2, currItem->pixm.qImagePtr()->height() / 2);
+			p->scale(1.0 / m_canvas->scale(), 1.0 / m_canvas->scale());
+			p->setPen(QPen(Qt::blue, 1.0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
+			p->drawLine(-10, 0, 10, 0);
+			p->drawLine(0, -10, 0, 10);
+			p->setBrush(QColor(0,0,255,70));
+			p->drawEllipse(QPointF(0.0, 0.0), 10.0, 10.0);
+			p->restore();
+		}
 	}
 }
 




More information about the scribus-commit mailing list