@@ -65,9 +65,6 @@ void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem*
65
65
66
66
double penWidth = pen ().widthF ();
67
67
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 );
71
68
72
69
if ( mHtmlState )
73
70
{
@@ -245,37 +242,6 @@ QFont QgsComposerLabel::font() const
245
242
return mFont ;
246
243
}
247
244
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
-
279
245
bool QgsComposerLabel::writeXML ( QDomElement& elem, QDomDocument & doc ) const
280
246
{
281
247
QString alignment;
@@ -370,7 +336,7 @@ bool QgsComposerLabel::readXML( const QDomElement& itemElem, const QDomDocument&
370
336
if ( composerItemElem.attribute ( " rotation" , " 0" ).toDouble () != 0 )
371
337
{
372
338
// check for old (pre 2.1) rotation attribute
373
- mItemRotation = composerItemElem.attribute ( " rotation" , " 0" ).toDouble ();
339
+ setItemRotation ( composerItemElem.attribute ( " rotation" , " 0" ).toDouble () );
374
340
}
375
341
376
342
_readXML ( composerItemElem, doc );
0 commit comments