[gimp] Allow editing text size when using the editor window



commit 2c3e62d926a809ee1231f54bfa85a1a1f74d5379
Author: houda <aliabbas houda gmail com>
Date:   Tue May 19 14:06:25 2020 +0200

    Allow editing text size when using the editor window

 app/widgets/gimptextstyleeditor.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
---
diff --git a/app/widgets/gimptextstyleeditor.c b/app/widgets/gimptextstyleeditor.c
index 7f0a542305..d090aa1380 100644
--- a/app/widgets/gimptextstyleeditor.c
+++ b/app/widgets/gimptextstyleeditor.c
@@ -863,6 +863,19 @@ gimp_text_style_editor_size_changed (GimpSizeEntry       *entry,
       gimp_text_buffer_set_size (editor->buffer, &start, &end,
                                  PANGO_SCALE * points);
     }
+  else
+    {
+      GtkTextIter start, end;
+      gdouble points;
+      gint size;
+      size = gtk_text_buffer_get_char_count(buffer);
+      points = gimp_units_to_points (gimp_size_entry_get_refval (entry, 0),
+                                     GIMP_UNIT_PIXEL, 
+                                     editor->resolution_y);
+      gtk_text_buffer_get_iter_at_offset(buffer, &start, 0);
+      gtk_text_buffer_get_iter_at_offset(buffer, &end, size);
+      gimp_text_buffer_set_size (editor->buffer, &start, &end, PANGO_SCALE * points);
+    }
 
   insert_tags = gimp_text_style_editor_list_tags (editor, &remove_tags);
   gimp_text_buffer_set_insert_tags (editor->buffer, insert_tags, remove_tags);


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