It is working fine, but isn't it equivalent to the following?

```scala
Math.max(originalAdjustment, -region.getTextLength)
```