Patch for gtklayout.c



Hello,

The following patch solves the following problems of the gtk version 
1.3 text widget:

 * Makes the center alignment property actually center the text.

 * Make the right mouse click position the cursor correctly in center 
   and right aligned text.

 * Mouse click for text position works in the whole width of the text
   widget.

Please consider if this patch looks reasonable, and then someone
with write permission, please apply it to the CVS tree.

Regards,
--
                                                        ___   ___
                                                      /  o  \   o \
Dov Grobgeld                                         ( o  o  ) o   |
The Weizmann Institute of Science, Israel             \  o  /o  o /
"Where the tree of wisdom carries oranges"              | |   | |
                                                       _| |_ _| |_

--- gtk+-1.3.7.org/gtk/gtktextlayout.c	Sun Sep  2 21:43:00 2001
+++ gtk+-1.3.7/gtk/gtktextlayout.c	Thu Sep 20 21:52:46 2001
@@ -1960,8 +1960,6 @@
 
   pango_layout_get_extents (display->layout, NULL, &extents);
 
-  display->x_offset += (display->total_width - PANGO_PIXELS (extents.x + extents.width)) * align;
-
   display->width = PANGO_PIXELS (extents.width) + display->left_margin + display->right_margin;
   display->height += PANGO_PIXELS (extents.height);
   
@@ -2142,8 +2140,8 @@
   */
   if (x < 0)
     x = 0;
-  if (x > layout->width)
-    x = layout->width;
+  if (x > display->x_offset + layout->width)
+    x = display->x_offset + layout->width;
 
   get_line_at_y (layout, y, &line, &line_top);
 




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