Fix logic of caching display string positions for bidi display.