Changeset 3882
- Timestamp:
- 03/05/06 22:30:00 (3 years ago)
- Files:
-
- Footagehead/trunk/FHController.m (modified) (4 diffs)
- Footagehead/trunk/FHImageView.m (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Footagehead/trunk/FHController.m
r3879 r3882 38 38 #import "FHSettings.h" 39 39 40 static FHController *sharedController; 40 #define FHUnloadImageCount 5 41 #define FHPreloadImageCount 10 42 43 static FHController *sharedController; 41 44 42 45 … … 267 270 count = [files count]; 268 271 269 // --- purge all but the last 5images270 if(row > 5) {271 for(i = 0; i < count && i < row - 5; i++) {272 // --- purge all but the last couple of images 273 if(row > FHUnloadImageCount) { 274 for(i = 0; i < count && i < row - FHUnloadImageCount; i++) { 272 275 file = [files objectAtIndex:i]; 273 276 … … 283 286 } 284 287 285 // --- load the next 10images288 // --- load the next couple of images 286 289 for(i = row, images = 0; i < count; i++) { 287 290 file = [files objectAtIndex:i]; … … 290 293 goto next; 291 294 292 if(++images > 10)295 if(++images > FHPreloadImageCount) 293 296 break; 294 297 Footagehead/trunk/FHImageView.m
r3879 r3882 82 82 - (void)_adjustScaling { 83 83 NSSize contentSize, imageSize, frameSize; 84 float size; 84 85 85 86 if(_scrollView) { 86 [_scrollView setHasHorizontalScroller:NO];87 [_scrollView setHasVerticalScroller:NO];88 87 contentSize = [_scrollView contentSize]; 89 88 90 89 if(_image && _imageScaling == NSScaleNone) { 91 90 imageSize = _image ? [_image size] : NSZeroSize; 91 92 if(ABS(_imageRotation) == 90.0 || ABS(_imageRotation) == 270.0) { 93 size = imageSize.width; 94 imageSize.width = imageSize.height; 95 imageSize.height = size; 96 } 97 92 98 frameSize = NSMakeSize(MAX(contentSize.width, imageSize.width), MAX(contentSize.height, imageSize.height)); 93 99 … … 98 104 [self scrollPoint:NSMakePoint(0.0, frameSize.height)]; 99 105 } else { 106 [_scrollView setHasHorizontalScroller:NO]; 107 [_scrollView setHasVerticalScroller:NO]; 108 100 109 [self setFrameSize:contentSize]; 101 110 } … … 184 193 _imageRotation = imageRotation; 185 194 195 [self _adjustScaling]; 186 196 [self setNeedsDisplay:YES]; 187 197 } … … 304 314 switch (_imageScaling) { 305 315 case NSScaleProportionally: 306 dx = bounds.size.width / rect.size.width; 307 dy = bounds.size.height / rect.size.height; 308 d = dx < dy ? dx : dy; 316 if(ABS(_imageRotation) == 90.0 || ABS(_imageRotation) == 270.0) { 317 dx = bounds.size.width / rect.size.height; 318 dy = bounds.size.height / rect.size.width; 319 } else { 320 dx = bounds.size.width / rect.size.width; 321 dy = bounds.size.height / rect.size.height; 322 } 323 324 d = dx < dy ? dx : dy; 309 325 310 326 if(d < 1.0) {
