typemytype / drawbot

http://www.drawbot.com
Other
408 stars 63 forks source link

stroke(None) renders differently from stroke(0, 0, 0, 0) #448

Closed roberto-arista closed 3 years ago

roberto-arista commented 3 years ago

Dear @justvanrossum and @typemytype,

I assumed that stroke(None) and stroke(0, 0, 0, 0) would render the same result, but if I run this script:

newPage(50, 50)
fontSize(12)

stroke(None)
fill(1, 0, 0, 1)
text("Stroke", (5, 10))

stroke(0, 0, 0, 0)
fill(1, 0, 0, 1)
text("Stroke", (5, 25))

saveImage('stroke.png')

The results on a output PNG are slightly different:

stroke

Am I missing something? I know it's a minor thing, but I am curious 🤓

Thanks! 👋

justvanrossum commented 3 years ago

stroke(None) and stroke() are equivalent and draw no stroke, stroke(0, 0, 0, 0) draws a black stroke with 0 alpha. Apparently the OS renderer treats that as different. I'm not quite surprosed, though. Please use stroke(None) to say "no stroke".

roberto-arista commented 3 years ago

I will, thanks : )