Commit 45f7df034f85fba2ddcf7fd0027d16f62a09e236

Authored by perry.werneck@gmail.com
1 parent 5ecc2475
Exists in master and in 1 other branch develop

Corrigindo problema no sublinhado...

Fórum: PW3270 Suporte
Thread: Sublinhado Versão 5.0
Último Post: David Dourado
Enviados: 2013-01-09 18:35:31.386784-02

Caros,

Ao instalar a  versão 5.0 (GTK 3.6) no Windows 7 64 bits percebemos que
os inputs não tem o sublinhado.

Resolvemos instalar a versão 4.2 e percebemos que funcionou
perfeitamente. 

P.S.: Não tentamos instalar a versão 5 em outros ambientes. 

Isto é um novo comportamento padrão ou há um problema?
Showing 1 changed file with 23 additions and 0 deletions   Show diff stats
draw.c
... ... @@ -119,6 +119,28 @@ void v3270_draw_element(cairo_t *cr, unsigned char chr, unsigned short attr, H32
119 119  
120 120 get_element_colors(attr,&fg,&bg,color);
121 121 v3270_draw_char(cr,chr,attr,session,height,rect,fg,bg);
  122 +
  123 + if(attr & LIB3270_ATTR_UNDERLINE)
  124 + {
  125 + cairo_scaled_font_t * font = cairo_get_scaled_font(cr);
  126 + cairo_font_extents_t extents;
  127 + double sl;
  128 +
  129 + cairo_scaled_font_extents(font,&extents);
  130 +
  131 + sl = extents.descent/3;
  132 + if(sl < 1)
  133 + sl = 1;
  134 +
  135 + gdk_cairo_set_source_color(cr,fg);
  136 +
  137 + cairo_rectangle(cr,rect->x,rect->y+sl+extents.ascent+(extents.descent/2),rect->width,sl);
  138 + cairo_fill(cr);
  139 +
  140 + cairo_stroke(cr);
  141 + }
  142 +
  143 +
122 144 }
123 145  
124 146 void v3270_draw_char(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 *session, guint height, GdkRectangle *rect, GdkColor *fg, GdkColor *bg)
... ... @@ -262,6 +284,7 @@ void v3270_draw_char(cairo_t *cr, unsigned char chr, unsigned short attr, H3270
262 284 g_free(utf);
263 285 }
264 286 }
  287 +
265 288 cairo_stroke(cr);
266 289 }
267 290  
... ...