Ticket #8 (new bug)

Opened 3 years ago

Last modified 3 years ago

Question about UIView and CALayer

Reported by: farivar2 Assigned to: farivar2
Priority: 3 - important Milestone: Sake
Component: MyCampus — iPhone Keywords:
Cc: State: Analyze

Description

In line 233 of MCMapsView.m, you call [self setNeedsLayout];

instead of

[self setNeedsDisplay].

Now this is what I guess. setNeedsDisplay calls the drawRect function, which is usually called by the system when needed anyway. However, in this case, in MCOpenGLESView.m, we call the drawView function by means of a timer. The drawView function then calls "draw" function, which we re-implement in the MCMapsView. Thus, no need to setNeedsDisplay.

However, given this is true, we wouldn't need to call setNeedsDisplay anyway, since the timer in MCOpenGLESView is going to ask to redraw the screen in like 16 ms anyway?

Change History

02/25/09 12:35:33 changed by kcathey2

  • owner changed from kcathey2 to farivar2.
  • priority changed from 4 - nice to have to 3 - important.
  • state changed from Verify to Analyze.

Yes, calling setNeedsDisplay should do it. We might want to think about moving the drawing stuff from layoutSubviews into drawRect. However, creating the frame buffers and EAGLContext instances should still happen in layoutSubviews because we only need to create a new context when the view changes size. Also, you might want to move off using the timer as well.