Problems drawing... Need help please.
Problems drawing... Need help please.
- Subject: Problems drawing... Need help please.
- From: "Brian O'Brien" <email@hidden>
- Date: Sun, 23 Oct 2005 14:57:33 -0600
Sorry if this code is in Python.. but its calling NS routines.
I'm having trouble getting the line caps and joints and colors
correct...
I basically want to set a color, draw a path then on to the next
object to be drawn...
Seems like every thing is being drawn in one color only...
self.path.setLineJoinStyle_(NSMiterLineJoinStyle)
self.path.setLineCapStyle_(NSButtLineCapStyle)
if self.mouseHit == True:
NSColor.colorWithDeviceRed_green_blue_alpha_(sfr,
sfg, sfb, sfa).set()
self.path.fill()
NSColor.colorWithDeviceRed_green_blue_alpha_(sor,
sog, sob, soa).set()
self.path.stroke()
else:
NSColor.colorWithDeviceRed_green_blue_alpha_(nfr,
nfg, nfb, nfa).set()
self.path.fill()
NSColor.colorWithDeviceRed_green_blue_alpha_(nor,
nog, nob, noa).set()
self.path.stroke()
self.path.closePath()
if ((self.mouseInBounds == True) |
(self.selectedControlPoint[0] == True)):
i = 0
for pt in self.controlPoints:
if (self.selectedControlPoint[0] == True) & (i
== self.selectedControlPoint[1]):
NSColor.colorWithDeviceRed_green_blue_alpha_
(0,0,1,1)
print 'hit'
else:
NSColor.colorWithDeviceRed_green_blue_alpha_
(0,1,1,1)
print 'miss'
r = NSRect((pt.x-1, pt.y-1), (3, 3))
p = NSBezierPath.bezierPathWithRect_(r)
p.closePath()
p.fill()
p.stroke()
i = i + 1
_______________________________________________
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