EVALUATION
Sometimes an offset calculated by Utilities.getTabbedTextOffset() points to the position beyond the passed-in segment area. This is a bug. Usually there's no harm as the segment usually contains data past the end of the area, but in rare cases when it does not, charsWidth() throws an exception.
This bug is revealed by 6760148 where getTabbedTextOffset() tries to actually read segment data at the calculated offset.
I think the best solution here is to rollback changes introduced by 6760148 and check for width overflow in GlyphView.breakView(), ie, the actual place where it matters.
It happened that Utilities.getTabbedTextOffset() is too low-level and too general for this particular task.
|