• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Core Animation. issue with scaling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Animation. issue with scaling


  • Subject: Re: Core Animation. issue with scaling
  • From: Eric Wing <email@hidden>
  • Date: Fri, 20 Aug 2010 16:46:40 -0700

> CABasicAnimation *animation =
>                  [CABasicAnimation animationWithKeyPath:@"bounds"];
>                 CGRect orgVal = CGRectMake(0, 0,
> firstWheelLayer.bounds.size.width, firstWheelLayer.bounds.size.height);
>                 CGRect newVal = CGRectMake(0, 0,
> firstWheelLayer.bounds.size.width+100, firstWheelLayer.bounds.size.height);
>
>                  [animation setFromValue:[NSValue valueWithCGRect:orgVal]];
>                  [animation setToValue:[NSValue valueWithCGRect:newVal]];
>                  [animation setDuration:5.0];
>                  [firstWheelLayer setBounds:newVal];
>                  [firstWheelLayer addAnimation:animation forKey:@"flag"];
>
> The problem here is that the sublayers do not scale horizontaly like the
> "firstWheelLayer" should I set their bounds here too?

I'm a little rusty on my Core Animation, but have you tried using the
actual "scale" property in Core Animation instead of using the bounds
property? I think the problem with using bounds is you are only
setting the dimensions of the specific layer, not the transformation
matrix. Since layers may be used as containers to contain other layers
and they do not clip, I wouldn't expect setting the bounds on a layer
would cause its children to transform.

-Eric
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Core Animation. issue with scaling
      • From: Ahsan Shafiq <email@hidden>
References: 
 >Core Animation. issue with scaling (From: Ahsan Shafiq <email@hidden>)

  • Prev by Date: Re: 9
  • Next by Date: Re: Best way to draw large tiled images?
  • Previous by thread: Re: Core Animation. issue with scaling
  • Next by thread: Re: Core Animation. issue with scaling
  • Index(es):
    • Date
    • Thread