mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
get all layouts from the same place
This commit is contained in:
parent
9521b71be9
commit
1892d24317
1 changed files with 3 additions and 10 deletions
|
@ -292,12 +292,7 @@ draw_string_at( GtkDrawCtx* dctx, PangoLayout* layout,
|
|||
if ( !!layout ) {
|
||||
g_object_ref( layout );
|
||||
} else {
|
||||
layout = pango_cairo_create_layout( cr );
|
||||
gchar buf[32];
|
||||
sprintf( buf, "Sans Bold %d", (fontHt * 2) / 3 );
|
||||
PangoFontDescription* desc = pango_font_description_from_string( buf );
|
||||
pango_layout_set_font_description( layout, desc );
|
||||
pango_font_description_free( desc );
|
||||
layout = layout_for_ht( dctx, fontHt );
|
||||
}
|
||||
|
||||
pango_layout_set_text( layout, (char*)str, XP_STRLEN(str) );
|
||||
|
@ -1382,13 +1377,11 @@ allocAndSet( GDKCOLORMAP* map, GdkRGBA* color, unsigned short red,
|
|||
DrawCtx*
|
||||
gtkDrawCtxtMake( GtkWidget* drawing_area, GtkGameGlobals* globals )
|
||||
{
|
||||
GtkDrawCtx* dctx = g_malloc0( sizeof(GtkDrawCtx) );
|
||||
|
||||
short ii;
|
||||
GtkDrawCtx* dctx = g_malloc0( sizeof(*dctx) );
|
||||
|
||||
dctx->vtable = g_malloc( sizeof(*(((GtkDrawCtx*)dctx)->vtable)) );
|
||||
|
||||
for ( ii = 0; ii < VSIZE(dctx->vtable); ++ii ) {
|
||||
for ( int ii = 0; ii < VSIZE(dctx->vtable); ++ii ) {
|
||||
((void**)(dctx->vtable))[ii] = draw_doNothing; /* bad? */
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue