- Timestamp:
- Dec 4, 2014 2:41:55 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r53389 r53443 281 281 void UIMachineView::sltHandleNotifyUpdate(int iX, int iY, int iWidth, int iHeight) 282 282 { 283 /* Prepare corresponding viewport part: */ 284 QRect rect; 285 283 286 /* Take the scale-factor into account: */ 284 287 const double dScaleFactor = gEDataManager->scaleFactor(vboxGlobal().managedVMUuid()); 285 288 if (dScaleFactor == 1) 286 289 { 287 /* Just update corresponding viewport part: */ 288 viewport()->update(iX - contentsX(), iY - contentsY(), iWidth, iHeight); 290 /* Adjust corresponding viewport part: */ 291 rect.moveTo(iX - contentsX(), 292 iY - contentsY()); 293 rect.setSize(QSize(iWidth, 294 iHeight)); 289 295 } 290 296 else 291 297 { 292 /* Calculate corresponding viewport part: */ 293 QRect rect(iX * dScaleFactor - 1 - contentsX(), 294 iY * dScaleFactor - 1 - contentsY(), 295 iWidth * dScaleFactor + 2 * dScaleFactor + 1, 296 iHeight * dScaleFactor + 2 * dScaleFactor + 1); 297 /* Limit the resulting part by the viewport rectangle: */ 298 rect &= viewport()->rect(); 299 /* Update corresponding viewport part: */ 300 viewport()->update(rect); 301 } 298 /* Adjust corresponding viewport part: */ 299 rect.moveTo(iX * dScaleFactor - 1 - contentsX(), 300 iY * dScaleFactor - 1 - contentsY()); 301 rect.setSize(QSize(iWidth * dScaleFactor + 2 * dScaleFactor + 1, 302 iHeight * dScaleFactor + 2 * dScaleFactor + 1)); 303 } 304 305 /* Limit the resulting part by the viewport rectangle: */ 306 rect &= viewport()->rect(); 307 308 /* Update corresponding viewport part: */ 309 viewport()->update(rect); 302 310 } 303 311
Note:
See TracChangeset
for help on using the changeset viewer.