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 | 118 | { |
| 119 | 119 | int addr = lib3270_get_cursor_address(host); |
| 120 | 120 | char buffer[10]; |
| 121 | - cairo_text_extents_t extents; | |
| 122 | 121 | |
| 123 | 122 | short2string(buffer,(addr/cols)+1,3); |
| 124 | 123 | buffer[3] = '/'; |
| 125 | 124 | short2string(buffer+4,(addr%cols)+1,3); |
| 126 | 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 | 128 | rect->x -= rect->width; |
| 131 | 129 | |
| 132 | - | |
| 133 | 130 | if(lib3270_get_toggle(host,LIB3270_TOGGLE_CURSOR_POS)) |
| 134 | 131 | { |
| 135 | 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 | 663 | if(lib3270_get_toggle(session,LIB3270_TOGGLE_CURSOR_POS)) |
| 667 | 664 | { |
| 668 | 665 | // Update OIA |
| 666 | + cairo_text_extents_t extents; | |
| 667 | + | |
| 669 | 668 | cr = set_update_region(terminal,&rect,V3270_OIA_CURSOR_POSITION); |
| 670 | 669 | |
| 671 | 670 | short2string(buffer,row+1,3); |
| ... | ... | @@ -673,6 +672,8 @@ void v3270_update_cursor(H3270 *session, unsigned short row, unsigned short col, |
| 673 | 672 | short2string(buffer+4,col+1,3); |
| 674 | 673 | buffer[7] = 0; |
| 675 | 674 | |
| 675 | + cairo_text_extents(cr,buffer,&extents); | |
| 676 | + | |
| 676 | 677 | cairo_move_to(cr,rect->x,rect->y+terminal->metrics.height); |
| 677 | 678 | cairo_show_text(cr, buffer); |
| 678 | 679 | cairo_stroke(cr); | ... | ... |