Skip to content

Commit

Permalink
Use the center of bounding rectangles for Gecko
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonard de Ruijter committed Aug 6, 2018
1 parent 99d3d02 commit c19970e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/NVDAObjects/IAccessible/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ def _getPointFromOffsetInObject(cls,obj,offset):
raise NotImplementedError
# Normally, L{_getPointFromOffset} implementations that rely on
# character bounding rectangles use the center point of the rectangle.
# However, using the center could result in a point of which Gecko IA2
# Using the center could result in a point of which Gecko IA2
# believes that it belongs to offset+1.
# This means that, when you use l{_getOffsetFromPoint}, the result would be offset+1.
# Therefore, use the upper left corner of the bounding rectangle in this case.
point=textInfos.Point(res[0],res[1])
# We yet stay with the center of the character, though.
point=textInfos.Point(res[0]+res[2]/2,res[1]+res[3]/2)
return point

def _getPointFromOffset(self,offset):
Expand Down

0 comments on commit c19970e

Please sign in to comment.