Solved: slow drawRect not displaying correctly
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