Skip to content

Commit

Permalink
[terminal]: Include origin when writing to a position (fixes #60)
Browse files Browse the repository at this point in the history
  • Loading branch information
bczsalba committed Apr 19, 2023
1 parent 8acbc89 commit b287562
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pytermgui/term.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,14 @@ def _slice(line: str, maximum: int) -> str:

if pos is not None:
xpos, ypos = pos
xpos += self.origin[0]
ypos += self.origin[1]

if slice_too_long:
if not self.height + self.origin[1] + 1 > ypos >= 0:
return

maximum = self.width - xpos + self.origin[0]
maximum = self.width - xpos

if xpos < self.origin[0]:
xpos = self.origin[0]
Expand Down

0 comments on commit b287562

Please sign in to comment.