Question

I have some view controller, that uses my own view class and XIB interface, so the view initializes from coder. In that view controller, when I move the slider, it redraws rectangle, in initial state rectangle is on full screen and when I move the slider to the left, the size of rect become smaller proportionally (from full screen to 10x14 continuously with 4 pixel intervals). The "slider did change a value" calls some method, that sets new rectangle size end sends "setNeedsDisplay" method. And if I change to "setNeedsDisplayInRect:" method, it not updates all what I need on screen, there is some artifacts. But with debugging it updates all like I want. Tried to send deferent rectangles to update, like:

redrawRect=CGRectUnion(oldRect, newRect);
[cView setNeedsDisplayInRect:redrawRect];

and some others, same story. My question is, which rectangle I need to send in "setNeedsDisplayInRect:" ?

And the second question, how can I accelerate/optimize all that story for smoother animation and less cost?

Was it helpful?

Solution

Already solved the problem 1. The "setNeedsDisplayInRect:" method uses points, and not pixels like I thought.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top