melatonin_blur
melatonin_blur copied to clipboard
Using spread will mess up the aspect ratio of the shadow
I'm writing a CSS renderer in JUCE and your blur module does the job almost perfectly. However the following CSS code:
{
background: #666;
height: 80px;
margin: 20px;
border: 5px solid green;
box-shadow: 0px 0px 0px 5px red;
/* x y blur spread color */
}
renders this output:
This is because it retains the aspect ratio of the path when using spread. If I change the scaling to not preserve the aspect ratio by passing in false as last parameter here:
https://github.com/sudara/melatonin_blur/blob/ae44478ff6de763551923c37afb0c81ea96243a8/melatonin/internal/rendered_single_channel_shadow.cpp#L28
I get this beauty:
Is there a reason why you retain the aspect ratio of the path when scaling up? Looks good with a square, not so good with any other shape :)
Hi there!
I totally missed this, didn't get a notification. I think I was on vacation?..
a CSS renderer in JUCE
Wow!
almost perfectly
I'll take it!
Is there a reason why
Sounds like a bug worth resolving. I'd be happy to take a PR for it if you felt motivated, especially if there's a test case added for it. Otherwise I can take a look...