The right edge of the text box, irrespective of direction.
To get the trailing edge (which may depend on the direction), consider end.
final double right;