@@ -65,9 +65,6 @@ void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem*
6565
6666 double penWidth = pen ().widthF ();
6767 QRectF painterRect ( penWidth + mMargin , penWidth + mMargin , mTextBoxWidth - 2 * penWidth - 2 * mMargin , mTextBoxHeight - 2 * penWidth - 2 * mMargin );
68- painter->translate ( rect ().width () / 2.0 , rect ().height () / 2.0 );
69- painter->rotate ( mItemRotation );
70- painter->translate ( -mTextBoxWidth / 2.0 , -mTextBoxHeight / 2.0 );
7168
7269 if ( mHtmlState )
7370 {
@@ -245,37 +242,6 @@ QFont QgsComposerLabel::font() const
245242 return mFont ;
246243}
247244
248- void QgsComposerLabel::setRotation ( double r )
249- {
250- // kept for api compatibility with QGIS 2.0
251- setItemRotation ( r );
252- }
253-
254- void QgsComposerLabel::setItemRotation ( double r )
255- {
256- double width = mTextBoxWidth ;
257- double height = mTextBoxHeight ;
258- QgsComposerItem::setItemRotation ( r );
259- sizeChangedByRotation ( width, height );
260-
261- double x = pos ().x () + rect ().width () / 2.0 - width / 2.0 ;
262- double y = pos ().y () + rect ().height () / 2.0 - height / 2.0 ;
263- QgsComposerItem::setSceneRect ( QRectF ( x, y, width, height ) );
264- }
265-
266- void QgsComposerLabel::setSceneRect ( const QRectF& rectangle )
267- {
268- if ( rectangle.width () != rect ().width () || rectangle.height () != rect ().height () )
269- {
270- double textBoxWidth = rectangle.width ();
271- double textBoxHeight = rectangle.height ();
272- imageSizeConsideringRotation ( textBoxWidth, textBoxHeight );
273- mTextBoxWidth = textBoxWidth;
274- mTextBoxHeight = textBoxHeight;
275- }
276- QgsComposerItem::setSceneRect ( rectangle );
277- }
278-
279245bool QgsComposerLabel::writeXML ( QDomElement& elem, QDomDocument & doc ) const
280246{
281247 QString alignment;
@@ -370,7 +336,7 @@ bool QgsComposerLabel::readXML( const QDomElement& itemElem, const QDomDocument&
370336 if ( composerItemElem.attribute ( " rotation" , " 0" ).toDouble () != 0 )
371337 {
372338 // check for old (pre 2.1) rotation attribute
373- mItemRotation = composerItemElem.attribute ( " rotation" , " 0" ).toDouble ();
339+ setItemRotation ( composerItemElem.attribute ( " rotation" , " 0" ).toDouble () );
374340 }
375341
376342 _readXML ( composerItemElem, doc );
0 commit comments