[vte/wip/egmont/bidi: 3/29] widget: Move out a common condition for painting the background



commit fb3be6570ce5a6b31d088e9776dc4bde0f76332e
Author: Egmont Koblinger <egmont gmail com>
Date:   Wed May 29 09:56:30 2019 +0200

    widget: Move out a common condition for painting the background

 src/vte.cc | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index d523367e..eecfc86d 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -8397,23 +8397,24 @@ Terminal::draw_cells(struct _vte_draw_text_request *items,
         else
                 rgb_from_index<4, 5, 4>(deco, dc);
 
-       i = 0;
-       do {
-               columns = 0;
-               x = items[i].x;
-               y = items[i].y;
-                /* Items are not necessarily contiguous. */
-                for (; i < n && items[i].x == x + columns * column_width && items[i].y == y; i++) {
-                       columns += items[i].columns;
-               }
-               if (clear && (draw_default_bg || back != VTE_DEFAULT_BG)) {
+        if (clear && (draw_default_bg || back != VTE_DEFAULT_BG)) {
+                /* Paint the background. */
+                i = 0;
+                do {
+                        columns = 0;
+                        x = items[i].x;
+                        y = items[i].y;
+                        /* Items are not necessarily contiguous. */
+                        for (; i < n && items[i].x == x + columns * column_width && items[i].y == y; i++) {
+                                columns += items[i].columns;
+                        }
                        _vte_draw_fill_rectangle(m_draw,
                                        x,
                                         y,
                                         columns * column_width, row_height,
                                        &bg, VTE_DRAW_OPAQUE);
-               }
-       } while (i < n);
+                } while (i < n);
+        }
 
         if (attr & VTE_ATTR_BLINK) {
                 /* Notify the caller that cells with the "blink" attribute were encountered (regardless of


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