[gtk] text: Move some locals into the closest scope



commit 4bb4a98493a139dfb22bd6a87b1f0ca18140399a
Author: Timm Bäder <mail baedert org>
Date:   Mon Jul 15 05:38:25 2019 +0200

    text: Move some locals into the closest scope

 gtk/gtktext.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index 0b7aa656ae..127e7d3568 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -4382,15 +4382,12 @@ gtk_text_draw_cursor (GtkText     *self,
   PangoLayout *layout;
   const char *text;
   int x, y;
-  int width, height;
 
   context = gtk_widget_get_style_context (widget);
 
   layout = gtk_text_ensure_layout (self, TRUE);
   text = pango_layout_get_text (layout);
   gtk_text_get_layout_offsets (self, &x, &y);
-  width = gtk_widget_get_width (widget);
-  height = gtk_widget_get_height (widget);
 
   if (type == CURSOR_DND)
     cursor_index = g_utf8_offset_to_pointer (text, priv->dnd_position) - text;
@@ -4410,6 +4407,8 @@ gtk_text_draw_cursor (GtkText     *self,
     }
   else /* overwrite_mode */
     {
+      int width = gtk_widget_get_width (widget);
+      int height = gtk_widget_get_height (widget);
       graphene_rect_t bounds;
 
       bounds.origin.x = PANGO_PIXELS (cursor_rect.x) + x;


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