• 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: redraw problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: redraw problem


  • Subject: Re: redraw problem
  • From: Markus Spoettl <email@hidden>
  • Date: Thu, 29 Jul 2010 23:23:54 -0400

On Jul 29, 2010, at 7:30 PM, Tony Romano wrote:
> Moved the code to here. http://dl.dropbox.com/u/5614061/snippet.txt
>
> The drawRect redraws the entire view.  So, in a sense, I am drawing over everything in that view.  What's interesting, is the lines are left from the first time I adjust the blue lines, any additional adjustments to the blue line don't leave any residuals.
>
> Changing the setLineWidth prior to any drawing doesn't have any affect on the problem.  Didn't think it would as I understand the "attributes" are not applied until the stroke happens.  I'll look into Quartz debug.


Not sure if that causes your problem but you should use -drawRect: to draw the view, nothing else. The first half sets visual properties of the window and another view. There are much better places to do that.

Secondly - and not sure if that causes the issue either - but it's good practice that whenever you change properties of the current graphics context, you should first store its state and restore it when you're done. That way things that use the same context after you did find it in a state they expect it in. See <http://developer.apple.com/mac/library/documentation/cocoa/reference/ApplicationKit/Classes/NSGraphicsContext_Class/Reference/Reference.html#//apple_ref/doc/uid/20000336-BAJBDIBC>

Regards
Markus
--
__________________________________________
Markus Spoettl

_______________________________________________

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

References: 
 >redraw problem (From: Tony Romano <email@hidden>)
 >Re: redraw problem (From: Michael Dautermann <email@hidden>)
 >Re: redraw problem (From: Tony Romano <email@hidden>)

  • Prev by Date: Re: [iphone] Hud style UIView
  • Next by Date: Re: redraw problem
  • Previous by thread: Re: redraw problem
  • Next by thread: Re: redraw problem
  • Index(es):
    • Date
    • Thread