diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/src/plugins/platforms/cocoa/qcocoabackingstore.mm index 639851e855..23a9edfa49 100644 --- a/src/plugins/platforms/cocoa/qcocoabackingstore.mm +++ b/src/plugins/platforms/cocoa/qcocoabackingstore.mm @@ -127,10 +127,11 @@ void QCocoaBackingStore::flush(QWindow *window, const QRegion ®ion, const QPo // FIXME: Figure out if there's a way to do partial updates view.layer.contents = (__bridge id)static_cast(cgImage); if (view != topLevelView) { + const CGSize topLevelSize = topLevelView.bounds.size; view.layer.contentsRect = CGRectApplyAffineTransform( [view convertRect:view.bounds toView:topLevelView], // The contentsRect is in unit coordinate system - CGAffineTransformMakeScale(1.0 / m_image.width(), 1.0 / m_image.height())); + CGAffineTransformMakeScale(1.0 / topLevelSize.width, 1.0 / topLevelSize.height)); } } else { // Normally a NSView is drawn via drawRect, as part of the display cycle in the