FROM : Axel Péju
DATE : Wed Nov 07 10:58:54 2007
Hi,
I've been experiencing some problems with Core Animation when resizing
a view containing CALayers. I've made a simple project that shows the
issue.
http://pacificturtle.free.fr/CoreAnimation.zip
Or here is the code:
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (self) {
rootLayer = [CALayer layer];
rootLayer.backgroundColor = [CAView color:C_BLACK];
rootLayer.layoutManager = [CAConstraintLayoutManager layoutManager];
CALayer *sublayer = [CALayer layer];
sublayer.backgroundColor = [CAView color:C_GRAY];
[sublayer addConstraint:[CAConstraint
constraintWithAttribute:kCAConstraintMinX
relativeTo:@"superlayer"
attribute:kCAConstraintMinX]];
[sublayer addConstraint:[CAConstraint
constraintWithAttribute:kCAConstraintWidth
relativeTo:@"superlayer"
attribute:kCAConstraintWidth]];
[sublayer addConstraint:[CAConstraint
constraintWithAttribute:kCAConstraintMidY
relativeTo:@"superlayer"
attribute:kCAConstraintMidY]];
[sublayer addConstraint:[CAConstraint
constraintWithAttribute:kCAConstraintHeight
relativeTo:@"superlayer"
attribute:kCAConstraintHeight]];
[rootLayer addSublayer:sublayer];
}
return self;
}
The rootLayer is filled with black and its sublayer is filled with
gray. This sublayer should resize itself to fill the rootLayer but
when I resize the window, it takes some time for the gray layer to
resize. Is this a bug or am I doing anything wrong ?
I am using a Powerbook G4 with a retail Leopard version.
Thanks
Axel
DATE : Wed Nov 07 10:58:54 2007
Hi,
I've been experiencing some problems with Core Animation when resizing
a view containing CALayers. I've made a simple project that shows the
issue.
http://pacificturtle.free.fr/CoreAnimation.zip
Or here is the code:
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (self) {
rootLayer = [CALayer layer];
rootLayer.backgroundColor = [CAView color:C_BLACK];
rootLayer.layoutManager = [CAConstraintLayoutManager layoutManager];
CALayer *sublayer = [CALayer layer];
sublayer.backgroundColor = [CAView color:C_GRAY];
[sublayer addConstraint:[CAConstraint
constraintWithAttribute:kCAConstraintMinX
relativeTo:@"superlayer"
attribute:kCAConstraintMinX]];
[sublayer addConstraint:[CAConstraint
constraintWithAttribute:kCAConstraintWidth
relativeTo:@"superlayer"
attribute:kCAConstraintWidth]];
[sublayer addConstraint:[CAConstraint
constraintWithAttribute:kCAConstraintMidY
relativeTo:@"superlayer"
attribute:kCAConstraintMidY]];
[sublayer addConstraint:[CAConstraint
constraintWithAttribute:kCAConstraintHeight
relativeTo:@"superlayer"
attribute:kCAConstraintHeight]];
[rootLayer addSublayer:sublayer];
}
return self;
}
The rootLayer is filled with black and its sublayer is filled with
gray. This sublayer should resize itself to fill the rootLayer but
when I resize the window, it takes some time for the gray layer to
resize. Is this a bug or am I doing anything wrong ?
I am using a Powerbook G4 with a retail Leopard version.
Thanks
Axel
| Related mails | Author | Date |
|---|---|---|
| Axel Péju | Nov 7, 10:58 | |
| Thomas Schlömer | Nov 7, 11:08 | |
| Axel Péju | Nov 7, 21:52 | |
| Bertrand Landry-He… | Nov 8, 12:42 | |
| Scott Anguish | Nov 8, 23:11 | |
| Scott Anguish | Nov 8, 23:11 | |
| Bertrand Landry-He… | Nov 11, 09:17 |






Cocoa mail archive

