Commit MetaInfo
Log Message
[mani2/cocoa] * renamed layers?DataForUndo to copyLayers?
Change Summary
Incremental Difference
| | @@ -60,6 +60,8 @@ | 60 | 60 | atPoint:(CGPoint)point; | 61 | 61 | - (void)setPixelWithColor:(uint32_t)color | 62 | 62 | atPoint:(CGPoint)point; | | 63 | +- (MMLayers *)copyLayers; | | 64 | +- (void)setLayersDataForUndo:(MMLayers *)layersData; | 63 | 65 | - (NSUInteger)count; | 64 | 66 | | 65 | 67 | @property(readonly) CGSize size; |
| | @@ -68,6 +70,5 @@ | 68 | 70 | @property NSUInteger currentIndex; | 69 | 71 | @property CGFloat currentLayerAlpha; | 70 | 72 | @property(assign) NSString *currentLayerBlendMode; | 71 | | -@property(assign) MMLayers *layersDataForUndo; | 72 | 73 | | 73 | 74 | @end |
| | @@ -152,7 +152,7 @@ | 152 | 152 | - (void)copyLayer | 153 | 153 | { | 154 | 154 | MMLayer *layer = [layerArray objectAtIndex:currentIndex]; | 155 | | - MMLayer *copiedLayer = [layer copy]; | | 155 | + MMLayer *copiedLayer = [layer copyLayer]; | 156 | 156 | [layerArray insertObject:copiedLayer | 157 | 157 | atIndex:currentIndex]; | 158 | 158 | [copiedLayer release]; |
| | @@ -313,13 +313,13 @@ | 313 | 313 | //[self recombine]; | 314 | 314 | } | 315 | 315 | | 316 | | -- (MMLayers *)layersDataForUndo | | 316 | +- (MMLayers *)copyLayers | 317 | 317 | { | 318 | 318 | MMLayers *data = [[MMLayers alloc] init]; | 319 | 319 | for (MMLayer *layer in layerArray) { | 320 | 320 | // addObjectでメモリ参照が1つ増えるのでリリースしないとメモリーリークが発生する | 321 | 321 | // 配列にメモリ管理を任せる | 322 | | - MMLayer *layerDataForUndo = layer.layerDataForUndo; | | 322 | + MMLayer *layerDataForUndo = [layer copyLayer]; | 323 | 323 | [data->layerArray addObject:layerDataForUndo]; | 324 | 324 | [layerDataForUndo release]; | 325 | 325 | } |
| | @@ -338,7 +338,7 @@ | 338 | 338 | // addObjectでメモリ参照が1つ増えるのでリリースしないとメモリーリークが発生する | 339 | 339 | // 配列にメモリ管理を任せる | 340 | 340 | MMLayer *layer = [[MMLayer alloc] initWithSize:size index:i]; | 341 | | - layer.layerDataForUndo = layerDataForUndo; | | 341 | + [layer setLayerDataForUndo:layerDataForUndo]; | 342 | 342 | [layerArray addObject:layer]; | 343 | 343 | [layer release]; | 344 | 344 | ++i; |
| | @@ -49,6 +49,7 @@ | 49 | 49 | size:(CGSize)size | 50 | 50 | index:(NSUInteger)i; | 51 | 51 | + (void)disposeCompositeBitmap; | | 52 | +- (id)copyLayer; | 52 | 53 | - (void)drawBitmapFrom:(CGContextRef)source | 53 | 54 | blendMode:(NSString *)mode; | 54 | 55 | - (void)drawBitmapTo:(CGContextRef *)dest; |
| | @@ -56,6 +57,7 @@ | 56 | 57 | atPoint:(CGPoint)point; | 57 | 58 | - (void)setPixelWithColor:(uint32_t)color | 58 | 59 | atPoint:(CGPoint)point; | | 60 | +- (void)setLayerDataForUndo:(MMLayer *)layerData; | 59 | 61 | | 60 | 62 | @property(readonly) CGSize size; | 61 | 63 | @property NSUInteger index; |
| | @@ -63,7 +65,6 @@ | 63 | 65 | @property BOOL visible; | 64 | 66 | @property CGFloat alpha; | 65 | 67 | @property(assign) CGContextRef bitmap; | 66 | | -@property(assign) MMLayer *layerDataForUndo; | 67 | 68 | @property(retain) NSString *blendMode; | 68 | 69 | | 69 | 70 | @end |
| | @@ -471,7 +471,7 @@ | 471 | 471 | #endif | 472 | 472 | } | 473 | 473 | | 474 | | -- (id)copy | | 474 | +- (id)copyLayer | 475 | 475 | { | 476 | 476 | MMLayer *layer = [[[self class] alloc] initWithSize:size | 477 | 477 | index:index]; |
| | @@ -524,12 +524,6 @@ | 524 | 524 | CGContextFillRect(bitmap, CGRectMake(point.x, point.y, 1, 1)); | 525 | 525 | } | 526 | 526 | | 527 | | -- (MMLayer *)layerDataForUndo | 528 | | -{ | 529 | | - // エイリアス的な役割を働いている | 530 | | - return [self copy]; | 531 | | -} | 532 | | - | 533 | 527 | - (void)setLayerDataForUndo:(MMLayer *)layerData | 534 | 528 | { | 535 | 529 | // 単にlayerData(MMLayerクラス)内のプロパティをコピーするだけなので、retainはしない |
Show on old repository browser
|