fix bug with dynamic 2d slice resizing