- Timestamp:
- May 22, 2015 9:28:22 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.cpp
r55854 r56022 213 213 break; 214 214 215 /* Calculate aspect-ratio: */ 216 double dAspectRatio = (double)uGuestWidth / uGuestHeight; 217 /* Look for the best aspect-ratio preset: */ 218 preset = bestAspectRatioPreset(dAspectRatio, m_ratios); 215 if (uGuestWidth > 0 && uGuestHeight > 0) 216 { 217 /* Calculate aspect-ratio: */ 218 const double dAspectRatio = (double)uGuestWidth / uGuestHeight; 219 /* Look for the best aspect-ratio preset: */ 220 preset = bestAspectRatioPreset(dAspectRatio, m_ratios); 221 } 219 222 220 223 /* Create image based on shallow copy or screenshot data, … … 246 249 break; 247 250 248 /* Calculate aspect-ratio: */249 LONG iOriginX , iOriginY;250 ULONG uGuestWidth , uGuestHeight, uBpp;251 /* Acquire guest-screen attributes: */ 252 LONG iOriginX = 0, iOriginY = 0; 253 ULONG uGuestWidth = 0, uGuestHeight = 0, uBpp = 0; 251 254 KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled; 252 255 display.GetScreenResolution(0, uGuestWidth, uGuestHeight, uBpp, iOriginX, iOriginY, monitorStatus); 253 if (uGuestWidth == 0 || uGuestHeight ==0)256 if (uGuestWidth > 0 && uGuestHeight > 0) 254 257 { 255 AssertMsgFailed(("Acquired guest screen resolution is %dx%d\n", 256 uGuestWidth, uGuestHeight)); 257 break; 258 /* Calculate aspect-ratio: */ 259 const double dAspectRatio = (double)uGuestWidth / uGuestHeight; 260 /* Look for the best aspect-ratio preset: */ 261 preset = bestAspectRatioPreset(dAspectRatio, m_ratios); 258 262 } 259 260 double dAspectRatio = (double)uGuestWidth / uGuestHeight;261 /* Look for the best aspect-ratio preset preset: */262 preset = bestAspectRatioPreset(dAspectRatio, m_ratios);263 263 264 264 /* Calculate size corresponding to aspect-ratio: */ … … 524 524 /* Make sure host-size and guest-size are valid: */ 525 525 AssertReturn(!hostSize.isNull(), QSize()); 526 AssertReturn(!guestSize.isNull(), hostSize); 526 if (guestSize.isNull()) 527 return hostSize; 527 528 528 529 /* Calculate host/guest aspect-ratio: */
Note:
See TracChangeset
for help on using the changeset viewer.