- Timestamp:
- Jun 20, 2017 1:39:18 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic3.cpp
r64729 r67507 224 224 int UIWizardNewVDPage3::sizeMBToSlider(qulonglong uValue, int iSliderScale) 225 225 { 226 /* Make sure *any* slider value is multiple of 512: */ 227 uValue /= 512; 228 229 /* Calculate result: */ 226 230 int iPower = log2i(uValue); 227 231 qulonglong uTickMB = qulonglong (1) << iPower; 228 232 qulonglong uTickMBNext = qulonglong (1) << (iPower + 1); 229 233 int iStep = (uValue - uTickMB) * iSliderScale / (uTickMBNext - uTickMB); 230 return iPower * iSliderScale + iStep; 234 int iResult = iPower * iSliderScale + iStep; 235 236 /* Return result: */ 237 return iResult; 231 238 } 232 239 … … 234 241 qulonglong UIWizardNewVDPage3::sliderToSizeMB(int uValue, int iSliderScale) 235 242 { 243 /* Calculate result: */ 236 244 int iPower = uValue / iSliderScale; 237 245 int iStep = uValue % iSliderScale; 238 246 qulonglong uTickMB = qulonglong (1) << iPower; 239 247 qulonglong uTickMBNext = qulonglong (1) << (iPower + 1); 240 return uTickMB + (uTickMBNext - uTickMB) * iStep / iSliderScale; 248 qulonglong uResult = uTickMB + (uTickMBNext - uTickMB) * iStep / iSliderScale; 249 250 /* Make sure *any* slider value is multiple of 512: */ 251 uResult *= 512; 252 253 /* Return result: */ 254 return uResult; 241 255 } 242 256
Note:
See TracChangeset
for help on using the changeset viewer.