| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| Hi, I'm currently doing some groundwork for some future developments. I have a need to draw large amounts 2d vector graphic data. For various reasons (cross platform, different "targets" on the same platform etc), I wrap quartz up in C++ layer. As a test, I'm using a simple subclassed NSView embedded in a scrollview, this is my drawRect from the custom class. - (void)drawRect:(NSRect)rect { CGContextRef myContext = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort]; CGContextSetRGBFillColor(myContext, 1, 1, 1, 1); CGContextFillRect(myContext, CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height)); CGContextSetRGBFillColor(myContext, 1, 1, 0, 0.5); CGContextFillRect(myContext, CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height)); CGContextSetRGBStrokeColor(myContext, 0, 0, 0, 1); CGContextMoveToPoint(myContext, 300, 40); CGContextAddLineToPoint(myContext, 600, 40); CGContextStrokePath(myContext); } Now the problem that I am experiencing is that when I scroll using the trackpad on my powerbook, the area that scrolls in is solid black, the "anti aliasing" appears to be saturating. However, scrolling using the actual scrollbars or the arrows does not exhibit the same problem, presumably because the area being scrolled in is much larger. setting copiesOnScroll to NO "fixes" the problem as this obviously causes a refresh of the entire visible rectangle rather than a copybits and redraw of a small amount of area. Disabling anti-aliasing also fixes the problem, this is not an option though! Does anybody have a nicer solution or workaround this problem? I'm guessing that the actual problem is due to the invalid region being non-integer, but I can't quite put my finger on it because (and this is from a windows software background) I'm drawing both the background and foreground. Any ideas!? Thanks.. Adrian |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartz-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartz-dev/email@hidden This email sent to email@hidden
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.