public Rect2 CalcValidArea(Rect2 rect)
    {
        //cell size is in 16 atm
        int cellSize = 16;
        //convert tilespace to worldspace
        Rect2 worldTileSpace = new Rect2(floor.GetUsedRect().Position *cellSize, floor.GetUsedRect().Size *cellSize);

        return(worldTileSpace.Clip(rect));
    }