Seems that you are testing if the interval  `(x+dev_total_dx, x+dev_total+dev_dx)` intersects with the interval `(xMin, xMax)`.
And you assume that `dev_dx > 0`, otherwise the first interval should be `(x+dev_total_dx+dev_dx, x+dev_total)`.

Later if you transform the bbox from the text coordinate system into device system, you need to min/max x/y from the 4 (transformed) corners.