• 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
Solved: slow drawRect not displaying correctly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Solved: slow drawRect not displaying correctly


  • Subject: Solved: slow drawRect not displaying correctly
  • From: John Nairn <email@hidden>
  • Date: Tue, 11 Apr 2006 13:42:39 -0700

Some graphical output of my scientific application draws many objects (mostly NSBezierPath's) in an NSView subclass within the drawRect method. It all works fine until the number of objects gets too large. When it is too large, some symptoms are:

1. Changing plot data and using [plotView setNeedsDisplay:YES] does indeed result in drawRect being called, but the plot does not change. Problems common when more than 2000 objects to draw.


[snip]

I remembered I had a similar problem before. I was plotting by setting the view bounds to match the bounds of the coordinates of my data. The problem I had before, which is the same problem here, is that Cocoa's NSView breaks if the view units from the frame per pixel gets less than about 0.0025 (or extent of bounds about 1 for a view with a frame width of 400 pixels). These scientific calculations were for a nano-scale device and thus had very small coordinates. I solved the problem by drawing my plot in micron or nanometer units instead of the previous millimeter units.

---------------
John Nairn (1-541-737-4265, FAX:1-541-737-3385)
Professor and Richardson Chair
Web Page: http://woodscience.oregonstate.edu/faculty/nairn.php (under construction)
FEA/MPM Web Page: http://oregonstate.edu/~nairnj



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: MightyMouse vs Cocoa
  • Next by Date: Re: Function definitions
  • Previous by thread: Re: MightyMouse vs Cocoa
  • Next by thread: Monitoring NSTextView Attributes
  • Index(es):
    • Date
    • Thread