Changeset 31299 in vbox
- Timestamp:
- Aug 2, 2010 1:18:12 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
r31214 r31299 107 107 { 108 108 /* Check if scale is requested: */ 109 if (!m_fShouldWeDoScale)110 return;111 112 109 /* Set new frame-buffer scale-factor: */ 113 110 frameBuffer()->setScaledSize(viewport()->size()); … … 185 182 emit resizeHintDone(); 186 183 184 pEvent->accept(); 187 185 return true; 188 186 } … … 196 194 AssertMsg(contentsX() == 0, ("Thats can't be, else notify Dsen!\n")); 197 195 AssertMsg(contentsY() == 0, ("Thats can't be, else notify Dsen!\n")); 198 viewport()->repaint((pPaintEvent->x() - 10 /* 10 pixels left to cover xRatio*10 */) * xRatio, 199 (pPaintEvent->y() - 10 /* 10 pixels left to cover yRatio*10 */) * yRatio, 200 (pPaintEvent->width() + 10 /* 10 pixels right to cover x shift */ + 10 /* 10 pixels right to cover xRatio*10 */) * xRatio, 201 (pPaintEvent->height() + 10 /* 10 pixels right to cover y shift */ + 10 /* 10 pixels right to cover yRatio*10 */) * yRatio); 202 203 // viewport()->repaint((int)(pPaintEvent->x() /* 10 pixels left to cover xRatio*10 */ * xRatio), 204 // (int)(pPaintEvent->y() /* 10 pixels left to cover yRatio*10 */ * yRatio), 205 // (int)(pPaintEvent->width() /* 10 pixels right to cover x shift */ /* 10 pixels right to cover xRatio*10 */ * xRatio) + 2, 206 // (int)(pPaintEvent->height() /* 10 pixels right to cover y shift */ /* 10 pixels right to cover yRatio*10 */ * yRatio) + 2); 196 /* Make sure we update always a bigger rectangle than requested to 197 * catch all rounding errors. (use 1 time the ratio factor and 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); 207 203 pEvent->accept(); 208 204 return true; … … 227 223 case QEvent::Resize: 228 224 { 229 /* Set the "guest needs to resize" hint. 230 * This hint is acted upon when (and only when) the autoresize property is "true": */ 231 m_fShouldWeDoScale = true; 232 QTimer::singleShot(300, this, SLOT(sltPerformGuestScale())); 225 /* Perform the actually resize */ 226 sltPerformGuestScale(); 233 227 break; 234 228 }
Note:
See TracChangeset
for help on using the changeset viewer.

