drawbot icon indicating copy to clipboard operation
drawbot copied to clipboard

drop shadow is applied to stroke through fill

Open frankrolf opened this issue 7 years ago • 5 comments

When applying a drop shadow to a stroked shape, it is visible in the supposedly-filled area:

strokeWidth(100)
stroke(1, 0, 0)
fill(0, 1, 0)
offset = (50, -50)
shadow(offset, 50, (0, 0, 1))
rect(200, 200, 600, 600)
saveImage('shady.png')

shady

frankrolf avatar Sep 21 '18 13:09 frankrolf

fill and stroke are two drawing instructions :) each of them have shadow properties switch one of them off to remove the shadow for the stroke

typemytype avatar Sep 21 '18 13:09 typemytype

I thought the shade belongs to the rect? Can you illustrate what you mean by “switch one of them off”? Thanks!

frankrolf avatar Sep 21 '18 14:09 frankrolf

a different shadow for fill and stroke

sw = 100

with savedState():
    fill(0, 1, 0)
    offset = (50, -50)
    shadow(offset, 50, (0, 0, 1))
    rect(200-sw*.5, 200-sw*.5, 600+sw, 600+sw)


with savedState():
    strokeWidth(sw)
    stroke(1, 0, 0)
    fill(None)
    offset = (-50, 50)
    shadow(offset, 50, (1, 0, 1))
    rect(200, 200, 600, 600)    
    

typemytype avatar Sep 21 '18 14:09 typemytype

can this be closed?

typemytype avatar Dec 14 '18 10:12 typemytype

Not sure. Is this really the intended behavior?

frankrolf avatar Dec 14 '18 11:12 frankrolf