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



commit 200706cd072ea0fc4d3177bfd0e4e61e68363bf9
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 cd9a565e..71164faa 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -8399,23 +8399,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]