qemacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemacs-commit] qemacs display.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs display.c
Date: Wed, 3 May 2017 08:58:23 -0400 (EDT)

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        17/05/03 08:58:23

Modified files:
        .              : display.c 

Log message:
        display: add window fields for character cell size
        - compute_client_area computes default character sizes in
          EditState.char_width and EditState.line_height.
        - edit_invalidate() takes extra parameter to invalidate
          all windows
        - do_toggle_full_screen() no longer toggles modeline
        - reset WF_POPLEFT in do_delete_other_windows
        - bind toggle-full-screen on C-c f
        - bind toggle-mode-line on C-c m
        - move fill_border to display.c

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/display.c?cvsroot=qemacs&r1=1.22&r2=1.23

Patches:
Index: display.c
===================================================================
RCS file: /sources/qemacs/qemacs/display.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- display.c   3 May 2017 10:50:49 -0000       1.22
+++ display.c   3 May 2017 12:58:23 -0000       1.23
@@ -400,40 +400,25 @@
 {
 }
 #endif
+
 /* draw only the border of a rectangle */
 void fill_border(EditState *s, int x, int y, int w, int h, int color)
 {
-    int w1, w2, h1, h2;
+    int x0, y0, w0, h0, w1, w2, h1, h2;
 
     /* fill the background */
-    w1 = x;
-    if (w1 < 0)
-        w1 = 0;
-    w2 = s->width - (x + w);
-    if (w2 < 0)
-        w2 = 0;
-    h1 = y;
-    if (h1 < 0)
-        h1 = 0;
-    h2 = s->height - (y + h);
-    if (h2 < 0)
-        h2 = 0;
+    x0 = s->xleft;
+    y0 = s->ytop;
+    w0 = s->width;
+    h0 = s->height;
+    w1 = max(0, x);
+    w2 = max(0, w0 - (x + w));
+    h1 = max(0, y);
+    h2 = max(0, h0 - (y + h));
 
-    fill_rectangle(s->screen,
-                   s->xleft, s->ytop,
-                   w1, s->height,
-                   color);
-    fill_rectangle(s->screen,
-                   s->xleft + s->width - w2, s->ytop,
-                   w2, s->height,
-                   color);
-    fill_rectangle(s->screen,
-                   s->xleft + w1, s->ytop,
-                   s->width - w1 - w2, h1,
-                   color);
-    fill_rectangle(s->screen,
-                   s->xleft + w1, s->ytop + s->height - h2,
-                   s->width - w1 - w2, h2,
-                   color);
+    if (w1) fill_rectangle(s->screen, x0, y0, w1, h0, color);
+    if (w2) fill_rectangle(s->screen, x0 + w0 - w2, y0, w2, h0, color);
+    if (h1) fill_rectangle(s->screen, x0 + w1, y0, w0 - w1 - w2, h1, color);
+    if (h2) fill_rectangle(s->screen, x0 + w1, y0 + h0 - h2, w0 - w1 - w2, h2, 
color);
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]