Is there a way to scale something inside a widget from a blueprint but keep it from rendering outside the widgets limits if it scales larger than it??

I was trying to make divisions inside a health bar depending on the amount of maximum health it has, but when I scaled the divisions from the character blueprint they started to appear outside of the HP bar, even outside the widget limits. As if the scaling happened after the rendering. This only happens when rendering on screen. When I render it to world does not seem to happen the same thing.

I managed to solve it wrapping the scales with a retainer box. They only show if they are inside the retainer box, even if they become larger than it.