Fix rendering of layers with masks that have different origins