@@ -204,23 +204,22 @@ void ImageChanger::updatePixmap()
204204 p.setOpacity (opacityCurImage_);
205205 QPixmap framePixmap = curImage_.movie ->currentPixmap ();
206206 framePixmap.setDevicePixelRatio (DpiScaleManager::instance ().curDevicePixelRatio ());
207+ int frameWidth = framePixmap.width () / DpiScaleManager::instance ().curDevicePixelRatio ();
208+ int frameHeight = framePixmap.height () / DpiScaleManager::instance ().curDevicePixelRatio ();
207209
208210 if (aspectRatioMode_ == ASPECT_RATIO_MODE_TILE) {
209211 // For tiling mode, we draw the image repeatedly to fill the entire area
210- int frameWidth = framePixmap.width () / DpiScaleManager::instance ().curDevicePixelRatio ();
211- int frameHeight = framePixmap.height () / DpiScaleManager::instance ().curDevicePixelRatio ();
212-
213212 if (frameWidth > 0 && frameHeight > 0 ) {
214213 for (int x = 0 ; x < WIDTH * G_SCALE; x += frameWidth) {
215214 for (int y = 0 ; y < 197 * G_SCALE; y += frameHeight) {
216- p.drawPixmap (x, y, framePixmap, 0 , 0 , framePixmap.width (), (y + frameHeight > 197 *G_SCALE) ? 197 *G_SCALE - y : frameHeight);
215+ p.drawPixmap (x, y, framePixmap, 0 , 0 , framePixmap.width (), (y + frameHeight > 197 *G_SCALE) ? ( 197 *G_SCALE - y) * DpiScaleManager::instance (). curDevicePixelRatio () : frameHeight * DpiScaleManager::instance (). curDevicePixelRatio () );
217216 }
218217 }
219218 }
220219 } else {
221220 // Start at y = 0 if image height is 197 (16:9)
222- yOffset = (197 *G_SCALE - framePixmap. height () )/2 ;
223- p.drawPixmap (0 , yOffset, framePixmap, 0 , 0 , framePixmap.width (), 197 *G_SCALE - yOffset);
221+ yOffset = (197 *G_SCALE - frameHeight )/2 ;
222+ p.drawPixmap (0 , yOffset, framePixmap, 0 , 0 , framePixmap.width (), ( 197 *G_SCALE - yOffset) * DpiScaleManager::instance (). curDevicePixelRatio () );
224223 }
225224
226225 if (prevGradient == GRADIENT_FLAG) {
0 commit comments