Ticket #4720: wallpaper-fix.diff
File wallpaper-fix.diff, 2.2 KB (added by , 14 years ago) |
---|
-
src/preferences/backgrounds/BackgroundImage.cpp
299 299 // else fall thru 300 300 case kScaledToFit: 301 301 if (fIsDesktop) { 302 destinationBitmapBounds = viewBounds; 302 if ((destinationBitmapBounds.Width() 303 / destinationBitmapBounds.Height()) 304 >= (viewBounds.Height() / viewBounds.Width())) { 305 float overlap = 306 (((viewBounds.Height() 307 / destinationBitmapBounds.Height()) 308 * destinationBitmapBounds.Width()) 309 - viewBounds.Height()) / 2; 310 destinationBitmapBounds.Set(-overlap, 0, 311 viewBounds.Height() + overlap, viewBounds.Height()); 312 } else { 313 float overlap = 314 (((viewBounds.Width() 315 / destinationBitmapBounds.Width()) 316 * destinationBitmapBounds.Height()) 317 - viewBounds.Width()) / 2; 318 destinationBitmapBounds.Set(0, -overlap, viewBounds.Width(), 319 viewBounds.Height() + overlap); 320 } 303 321 followFlags = B_FOLLOW_ALL; 304 322 break; 305 323 } -
src/kits/tracker/BackgroundImage.cpp
199 199 // else fall thru 200 200 case kScaledToFit: 201 201 if (fIsDesktop) { 202 destinationBitmapBounds = viewBounds; 202 if ((destinationBitmapBounds.Width() 203 / destinationBitmapBounds.Height()) 204 >= (viewBounds.Height() / viewBounds.Width())) { 205 float overlap = 206 (((viewBounds.Height() 207 / destinationBitmapBounds.Height()) 208 * destinationBitmapBounds.Width()) 209 - viewBounds.Height()) / 2; 210 destinationBitmapBounds.Set(-overlap, 0, 211 viewBounds.Height() + overlap, viewBounds.Height()); 212 } else { 213 float overlap = 214 (((viewBounds.Width() 215 / destinationBitmapBounds.Width()) 216 * destinationBitmapBounds.Height()) 217 - viewBounds.Width()) / 2; 218 destinationBitmapBounds.Set(0, -overlap, viewBounds.Width(), 219 viewBounds.Height() + overlap); 220 } 203 221 followFlags = B_FOLLOW_ALL; 204 222 break; 205 223 }