Re: Patch for gtklayout.c



dov imagic weizmann ac il writes:
 
> --- 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);
>    

I think this first change is right, I made it slightly more elaborate
by removing the "align" variable entirely.

> @@ -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);
>  

This is in get_iter_at_pixel()? isn't display uninitialized here?

Havoc




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