[pango/pango2] Fix confusion about tab units



commit a52044f746a913dd67a1d569ca77897faaaa0697
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jul 31 11:33:05 2022 -0400

    Fix confusion about tab units
    
    We were mixing up Pango units and pixels here.

 pango2/pango-line-breaker.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/pango2/pango-line-breaker.c b/pango2/pango-line-breaker.c
index ed237f48f..be0e520bf 100644
--- a/pango2/pango-line-breaker.c
+++ b/pango2/pango-line-breaker.c
@@ -689,10 +689,10 @@ get_tab_pos (Pango2LineBreaker *self,
       switch (pango2_tab_array_get_positions (self->tabs))
         {
         case PANGO2_TAB_POSITIONS_DEFAULT:
-          tab_unit = PANGO2_SCALE;
+          tab_unit = 1;
           break;
         case PANGO2_TAB_POSITIONS_PIXELS:
-          tab_unit = 1;
+          tab_unit = PANGO2_SCALE;
           break;
         case PANGO2_TAB_POSITIONS_SPACES:
           tab_unit = self->tab_width / 8;
@@ -705,7 +705,7 @@ get_tab_pos (Pango2LineBreaker *self,
   else
     {
       n_tabs = 0;
-       tab_unit = PANGO2_SCALE;
+       tab_unit = 1;
       *is_default = TRUE;
     }
 


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