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



commit 6368fbb70dbc44849ad352d5c133658d3979ca08
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 419b2eb0..05585765 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -8398,23 +8398,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]