# Bug in DropShadow::drawForRectangle

**URL:** <https://forum.juce.com/t/bug-in-dropshadow-drawforrectangle/23911>\
**Category:** General JUCE discussion\
**Created:** [August 26, 2017, 7:25pm UTC](https://forum.juce.com/t/bug-in-dropshadow-drawforrectangle/23911 "2017-08-26T19:25:45Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [August 30, 2017, 11:03am UTC](https://forum.juce.com/t/bug-in-dropshadow-drawforrectangle/23911/9 "2017-08-30T11:03:25Z")

</div>

It has something to do with the following calculation at [`juce_DropShadowEffect.cpp:139`](https://github.com/WeAreROLI/JUCE/blob/858b206553dcccc9c78cb8c337f404ad3888ab54/modules/juce_graphics/effects/juce_DropShadowEffect.cpp#L139):

```
const float radiusInset = (radius + 1) / 2.0f;
const float expandedRadius = radius + radiusInset;

```

If the resulting `expandedRadius*nativeScaleFactor` is not an integral number (where `nativeScaleFactor` is the scale factor of your monitor - so 2 for retina) then the gap seems to appear.

It’s odd because the `drawShadowSection` class use `removeFromLeft`/`removeFromRight` which shouldn’t result in there being a gap.

---

_[View the full topic](https://forum.juce.com/t/bug-in-dropshadow-drawforrectangle/23911)._
