layer.maskToBounds was disabled on resize

TODO: Check why this is necessary