Fix drawing of gap on palettes attached to widget - Fixes #4776