Re: Small animation
Re: Small animation
- Subject: Re: Small animation
- From: Glen Low <email@hidden>
- Date: Thu, 22 Jan 2004 16:20:34 +0800
I guess you are attempting move an image over a constant colored
background... In your code snippet (which follows) you are using a
image view and moving that view element around inside of a containing
view that is set to paint a constant color background. So you are
incurring the extra work of moving a view element (sub-class of
NSView) around in its containing view when instead it quicker to just
draw the image at the location you want in your view directly. No need
to use an image view. Additionally your drawRect method below is
completely repainting the whole of the containing view bounds not just
the part that needs updating. Sure it is being clipped as needed but
you are doing extra filling that is just going to be thrown away.
I was just thinking...
In my Graphviz GUI I have an NSImageView sitting inside of a
NSScrollView. Obviously the image view is not opaque, but the drawRect
must not be drawing the background either. Do you really make things
faster / more flicker free by having a custom view declare isOpaque to
be YES, and drawing a background in the drawRect? -- because in either
case, the background has to be blanked: either the system does it when
isOpaque is NO, or you have to do it when isOpaque is YES. (Note I am
talking about 10.2 optimization which precludes the non-overlapping
rects optimization.)
Cheers, Glen Low
---
pixelglow software | simply brilliant stuff
www.pixelglow.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.