Skip to content

Commit

Permalink
Fix-up of: "displayModel.getCaretRect: return a locationHelper.RectLT…
Browse files Browse the repository at this point in the history
…RB instance", fixes issue in PuTTY (nvaccess#10244)

* Fix-up of: displayModel.getCaretRect: return a locationHelper.RectLTRB instance

* Fix linting
  • Loading branch information
LeonarddeR authored and michaelDCurran committed Sep 18, 2019
1 parent e77dcbd commit 0e4bb4a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions source/displayModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,12 @@ def getCaretRect(obj):
)
if res != 0:
raise RuntimeError(f"displayModel_getCaretRect failed with res {res}")
return RectLTRB(left, top, right, bottom)
return RectLTRB(
left.value,
top.value,
right.value,
bottom.value
)

def getWindowTextInRect(bindingHandle, windowHandle, left, top, right, bottom,minHorizontalWhitespace,minVerticalWhitespace,stripOuterWhitespace=True,includeDescendantWindows=True):
text, cpBuf = watchdog.cancellableExecute(_getWindowTextInRect, bindingHandle, windowHandle, includeDescendantWindows, left, top, right, bottom,minHorizontalWhitespace,minVerticalWhitespace,stripOuterWhitespace)
Expand Down Expand Up @@ -565,7 +570,7 @@ class EditableTextDisplayModelTextInfo(DisplayModelTextInfo):
stripOuterWhitespace=False

def _findCaretOffsetFromLocation(
selff,
self,
caretRect: RectLTRB,
validateBaseline: bool = True,
validateDirection: bool = True
Expand Down

0 comments on commit 0e4bb4a

Please sign in to comment.