bug of "pango_layout_move_cursor_visually"

View: New views
2 Messages — Rating Filter:   Alert me  

bug of "pango_layout_move_cursor_visually"

by 王旭光 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I find a bug of  "pango_layout_move_cursor_visually":
the layout text is "012345" , I move cursor from (index:100, trailing:100) to left.  I first get (5, 5). I think it should be (5, 1), that is the rightest position.

the code is:
                int index = 100;
                int trailing = 100;
                int newIndex = 5;
                int newTrailing = 5;

                while (newIndex != -1)
                {
                    pango_layout_move_cursor_visually (layout, true, index, trailing, -1, &newIndex, &newTrailing);
                    MyTrace ("[%d,  %d]\n", newIndex, newTrailing);
                    index = newIndex;
                    trailing = newTrailing ;
                }



没有广告的终身免费邮箱,www.yeah.net

_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-list@...
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list

Re: bug of "pango_layout_move_cursor_visually"

by Behdad Esfahbod-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 08/11/2009 04:05 AM, 王旭光 wrote:
>
> I find a bug of "pango_layout_move_cursor_visually":
> the layout text is "012345" , I move cursor from (index:100,
> trailing:100) to left. I first get (5, 5). I think it should be (5, 1),
> that is the rightest position.

Hi,

I remember thinking that the docs for that function are a bit wrong.  Anyway,
filed a bug and will look into it later:

   http://bugzilla.gnome.org/show_bug.cgi?id=591733

You may want to CC yourself on the bug.

Thanks
behdad



> the code is:
> int index = 100;
> int trailing = 100;
> int newIndex = 5;
> int newTrailing = 5;
>
> while (newIndex != -1)
> {
> pango_layout_move_cursor_visually (layout, true, index, trailing, -1,
> &newIndex, &newTrailing);
> MyTrace ("[%d, %d]\n", newIndex, newTrailing);
> index = newIndex;
> trailing = newTrailing ;
> }
_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-list@...
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list