File tree 2 files changed +23
-1
lines changed
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,28 @@ void QgsComposerEffect::draw( QPainter *painter )
35
35
36
36
// Set desired composition mode then draw source
37
37
painter->setCompositionMode ( mCompositionMode );
38
- drawSource ( painter );
38
+
39
+ if ( mCompositionMode == QPainter::CompositionMode_SourceOver )
40
+ {
41
+ // Normal (sourceover) blending, do faster drawSource operation
42
+ drawSource ( painter );
43
+ return ;
44
+ }
45
+
46
+ // Otherwise, draw using pixmap so QPrinter output works as expected
47
+ if ( sourceIsPixmap () )
48
+ {
49
+ // No point in drawing in device coordinates (pixmap will be scaled anyways).
50
+ pixmap = sourcePixmap ( Qt::LogicalCoordinates, &offset );
51
+ }
52
+ else
53
+ {
54
+ // Draw pixmap in device coordinates to avoid pixmap scaling;
55
+ pixmap = sourcePixmap ( Qt::DeviceCoordinates, &offset );
56
+ painter->setWorldTransform ( QTransform () );
57
+ }
58
+
59
+ painter->drawPixmap ( offset, pixmap );
39
60
40
61
}
41
62
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ void QgsComposerItem::init( bool manageZValue )
103
103
// Setup composer effect
104
104
mEffect = new QgsComposerEffect ();
105
105
setGraphicsEffect ( mEffect );
106
+
106
107
}
107
108
108
109
QgsComposerItem::~QgsComposerItem ()
You can’t perform that action at this time.
0 commit comments