Commit 42a327a0bd1efbd6d148ade1efb0b5f06e6abd9d
1 parent
51b1179e
Exists in
master
and in
5 other branches
Corrigindo posicionamento do indicador de posição do cursor
Showing
1 changed file
with
5 additions
and
4 deletions
Show diff stats
src/gtk/v3270/oia.c
| @@ -118,18 +118,15 @@ static void setup_cursor_position(GdkRectangle *rect, struct v3270_metrics *metr | @@ -118,18 +118,15 @@ static void setup_cursor_position(GdkRectangle *rect, struct v3270_metrics *metr | ||
| 118 | { | 118 | { |
| 119 | int addr = lib3270_get_cursor_address(host); | 119 | int addr = lib3270_get_cursor_address(host); |
| 120 | char buffer[10]; | 120 | char buffer[10]; |
| 121 | - cairo_text_extents_t extents; | ||
| 122 | 121 | ||
| 123 | short2string(buffer,(addr/cols)+1,3); | 122 | short2string(buffer,(addr/cols)+1,3); |
| 124 | buffer[3] = '/'; | 123 | buffer[3] = '/'; |
| 125 | short2string(buffer+4,(addr%cols)+1,3); | 124 | short2string(buffer+4,(addr%cols)+1,3); |
| 126 | buffer[7] = 0; | 125 | buffer[7] = 0; |
| 127 | 126 | ||
| 128 | - cairo_text_extents(cr,buffer,&extents); | ||
| 129 | - rect->width = ((int) extents.width + 2); | 127 | + rect->width = metrics->width * 8; |
| 130 | rect->x -= rect->width; | 128 | rect->x -= rect->width; |
| 131 | 129 | ||
| 132 | - | ||
| 133 | if(lib3270_get_toggle(host,LIB3270_TOGGLE_CURSOR_POS)) | 130 | if(lib3270_get_toggle(host,LIB3270_TOGGLE_CURSOR_POS)) |
| 134 | { | 131 | { |
| 135 | cairo_move_to(cr,rect->x,rect->y+metrics->height); | 132 | cairo_move_to(cr,rect->x,rect->y+metrics->height); |
| @@ -666,6 +663,8 @@ void v3270_update_cursor(H3270 *session, unsigned short row, unsigned short col, | @@ -666,6 +663,8 @@ void v3270_update_cursor(H3270 *session, unsigned short row, unsigned short col, | ||
| 666 | if(lib3270_get_toggle(session,LIB3270_TOGGLE_CURSOR_POS)) | 663 | if(lib3270_get_toggle(session,LIB3270_TOGGLE_CURSOR_POS)) |
| 667 | { | 664 | { |
| 668 | // Update OIA | 665 | // Update OIA |
| 666 | + cairo_text_extents_t extents; | ||
| 667 | + | ||
| 669 | cr = set_update_region(terminal,&rect,V3270_OIA_CURSOR_POSITION); | 668 | cr = set_update_region(terminal,&rect,V3270_OIA_CURSOR_POSITION); |
| 670 | 669 | ||
| 671 | short2string(buffer,row+1,3); | 670 | short2string(buffer,row+1,3); |
| @@ -673,6 +672,8 @@ void v3270_update_cursor(H3270 *session, unsigned short row, unsigned short col, | @@ -673,6 +672,8 @@ void v3270_update_cursor(H3270 *session, unsigned short row, unsigned short col, | ||
| 673 | short2string(buffer+4,col+1,3); | 672 | short2string(buffer+4,col+1,3); |
| 674 | buffer[7] = 0; | 673 | buffer[7] = 0; |
| 675 | 674 | ||
| 675 | + cairo_text_extents(cr,buffer,&extents); | ||
| 676 | + | ||
| 676 | cairo_move_to(cr,rect->x,rect->y+terminal->metrics.height); | 677 | cairo_move_to(cr,rect->x,rect->y+terminal->metrics.height); |
| 677 | cairo_show_text(cr, buffer); | 678 | cairo_show_text(cr, buffer); |
| 678 | cairo_stroke(cr); | 679 | cairo_stroke(cr); |