Changeset 31318 in vbox
- Timestamp:
- Aug 2, 2010 4:19:19 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 64345
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBufferQuartz2D.cpp
r31233 r31318 184 184 { 185 185 CGImageRef pauseImg = ::darwinToCGImageRef(&m_pMachineView->pauseShot()); 186 subImage = CGImageCreateWithImageInRect(pauseImg, CGRectMake 186 subImage = CGImageCreateWithImageInRect(pauseImg, CGRectMake(m_pMachineView->contentsX(), m_pMachineView->contentsY(), m_pMachineView->visibleWidth(), m_pMachineView->visibleHeight())); 187 187 CGImageRelease(pauseImg); 188 188 } 189 189 else 190 subImage = CGImageCreateWithImageInRect(m_image, CGRectMake 190 subImage = CGImageCreateWithImageInRect(m_image, CGRectMake(m_pMachineView->contentsX(), m_pMachineView->contentsY(), m_pMachineView->visibleWidth(), m_pMachineView->visibleHeight())); 191 191 Assert(VALID_PTR(subImage)); 192 192 /* Clear the background (Make the rect fully transparent) */ … … 247 247 * of the bounding box of the current paint event */ 248 248 CGRect ir = ::darwinToCGRect(aEvent->rect()); 249 CGRect is = CGRectMake(CGRectGetMinX(ir) + m_pMachineView->contentsX(), CGRectGetMinY(ir) + m_pMachineView->contentsY(), CGRectGetWidth(ir), CGRectGetHeight(ir));249 CGRect is = CGRectMake(CGRectGetMinX(ir), CGRectGetMinY(ir), CGRectGetWidth(ir), CGRectGetHeight(ir)); 250 250 251 251 double iw = 1.0; … … 275 275 is.size.height = (int)(is.size.height * ih) + 2; 276 276 /* Make sure the size is within the image boundaries */ 277 is= CGRectIntersection(is, CGRectMake(0, 0, CGImageGetWidth(m_image), CGImageGetHeight(m_image)));277 CGRect is1 = CGRectIntersection(is, CGRectMake(0, 0, CGImageGetWidth(m_image), CGImageGetHeight(m_image))); 278 278 /* Cause we probably changed the rectangle to update in the origin 279 279 * coordinate system, we have to recalculate the update rectangle 280 280 * for the screen coordinates as well. Please note that this has to 281 281 * be in double precision. */ 282 ir.origin.x = is.origin.x / iw; 283 ir.origin.y = is.origin.y / ih; 284 ir.size.width = is.size.width / iw; 285 ir.size.height = is.size.height / ih; 286 /* Create the sub image */ 287 subImage = CGImageCreateWithImageInRect(m_image, is); 282 ir.origin.x = is1.origin.x / iw; 283 ir.origin.y = is1.origin.y / ih; 284 ir.size.width = is1.size.width / iw; 285 ir.size.height = is1.size.height / ih; 286 /* Create the sub image. Note: The copy step is necessary otherwise 287 * strange things happens especially on Snow Leopard. No idea why. */ 288 CGImageRef tmpImage = CGImageCreateWithImageInRect(m_image, is1); 289 subImage = CGImageCreateCopy(tmpImage); 290 CGImageRelease(tmpImage); 288 291 } 289 292 if (subImage) … … 306 309 CGContextSetInterpolationQuality(ctx, kCGInterpolationHigh); 307 310 /* Draw the image. */ 308 309 311 CGContextDrawImage(ctx, ::darwinFlipCGRect(ir, CGRectGetHeight(viewRect)), subImage); 310 312 CGImageRelease(subImage); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
r31299 r31318 197 197 * catch all rounding errors. (use 1 time the ratio factor and 198 198 * round down on top/left, but round up for the width/height) */ 199 viewport()->repaint((int)(pPaintEvent->x() * xRatio) - ((int)xRatio) ,200 (int)(pPaintEvent->y() * yRatio) - ((int)yRatio) ,201 (int)(pPaintEvent->width() * xRatio) + ((int)xRatio + 1) * 2,202 (int)(pPaintEvent->height() * yRatio) + ((int)yRatio + 1) * 2);199 viewport()->repaint((int)(pPaintEvent->x() * xRatio) - ((int)xRatio) - 1, 200 (int)(pPaintEvent->y() * yRatio) - ((int)yRatio) - 1, 201 (int)(pPaintEvent->width() * xRatio) + ((int)xRatio + 2) * 2, 202 (int)(pPaintEvent->height() * yRatio) + ((int)yRatio + 2) * 2); 203 203 pEvent->accept(); 204 204 return true;
Note:
See TracChangeset
for help on using the changeset viewer.