Changing how getCellX calculates offset, fixes #16924