Commit ce3413a5 authored by Claes Sjofors's avatar Claes Sjofors

Ge valueinput, bugfix in input cursor position

parent dbaca4c7
...@@ -3700,12 +3700,16 @@ int GlowDrawGtk::get_text_extent_pango( const char *text, int len, ...@@ -3700,12 +3700,16 @@ int GlowDrawGtk::get_text_extent_pango( const char *text, int len,
PangoLayout *layout; PangoLayout *layout;
if ( ((GrowCtx *)ctx)->text_coding != glow_eTextCoding_UTF_8) { if ( ((GrowCtx *)ctx)->text_coding != glow_eTextCoding_UTF_8) {
char *textutf8 = g_convert( text, -1, "UTF-8", "ISO8859-1", NULL, NULL, NULL); char *textutf8 = g_convert( text, len, "UTF-8", "ISO8859-1", NULL, NULL, NULL);
layout = gtk_widget_create_pango_layout( w->toplevel, textutf8); layout = gtk_widget_create_pango_layout( w->toplevel, textutf8);
g_free( textutf8); g_free( textutf8);
} }
else else {
layout = gtk_widget_create_pango_layout( w->toplevel, text); char *textp = (char *) calloc( 1, len + 1);
strncpy( textp, text, len);
layout = gtk_widget_create_pango_layout( w->toplevel, textp);
free( textp);
}
PangoFontDescription *desc = pango_font_description_from_string( font_string( font_idx, font_type, size)); PangoFontDescription *desc = pango_font_description_from_string( font_string( font_idx, font_type, size));
pango_layout_set_font_description( layout, desc); pango_layout_set_font_description( layout, desc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment