billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=2db4a0e980355804082dbcd635b9ee2cd32e5a0f

commit 2db4a0e980355804082dbcd635b9ee2cd32e5a0f
Author: Boris Faure <[email protected]>
Date:   Thu Nov 22 20:10:16 2018 +0100

    termptyesc: fix _clean_up_rect_coordinates() when cursor is restricted
---
 src/bin/termptyesc.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index 09830b6..118e3fb 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -1066,14 +1066,22 @@ _clean_up_rect_coordinates(Termpty *ty,
    int right = *right_ptr;
 
    TERMPTY_RESTRICT_FIELD(top, 1, ty->h);
-   top--;
    if (ty->termstate.restrict_cursor)
-     top += ty->termstate.top_margin;
+     {
+        top += ty->termstate.top_margin;
+        if (ty->termstate.bottom_margin && top >= ty->termstate.bottom_margin)
+          top = ty->termstate.bottom_margin;
+     }
+   top--;
 
    TERMPTY_RESTRICT_FIELD(left, 1, ty->w);
-   left--;
    if (ty->termstate.restrict_cursor)
-     left += ty->termstate.left_margin;
+     {
+        left += ty->termstate.left_margin;
+        if (ty->termstate.right_margin && left >= ty->termstate.right_margin)
+          left = ty->termstate.right_margin;
+     }
+   left--;
 
    if (right < 1)
      right = ty->w;
@@ -1092,7 +1100,7 @@ _clean_up_rect_coordinates(Termpty *ty,
      {
         bottom += ty->termstate.top_margin;
         if (ty->termstate.bottom_margin && bottom >= 
ty->termstate.bottom_margin)
-          bottom = ty->termstate.bottom_margin - 1;
+          bottom = ty->termstate.bottom_margin;
      }
    bottom--;
    if (bottom > ty->h)

-- 


Reply via email to