{
    const xLen = Math.pow(2, xScale);
    const left = 0;
    const right = mapSize - xLen;
    x = x < left ? left : x > right ? right : x;