Editor: fix selecting entities losing their order when changing the layer.