X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fswfc.c;h=e15f5a63d660d7d96e484dadcd1dc2d59680a963;hb=c7432833fe3a6469d63fad135151a92e12877b94;hp=27f6e9a018bed3f5075ff6e0149e383317a9a948;hpb=af4e935bee0c669a93488e5f40b4be071f47937b;p=swftools.git diff --git a/src/swfc.c b/src/swfc.c index 27f6e9a..e15f5a6 100644 --- a/src/swfc.c +++ b/src/swfc.c @@ -498,11 +498,11 @@ void s_buttonput(char*character, char*as, parameters_t p) while(1) { if(*s==',' || *s==0) { - if(!strncmp(o,"idle",s-o)) mybutton.records[0]=r; - else if(!strncmp(o,"shape",s-o)) mybutton.records[0]=r; - else if(!strncmp(o,"hover",s-o)) mybutton.records[1]=r; - else if(!strncmp(o,"pressed",s-o)) mybutton.records[2]=r; - else if(!strncmp(o,"area",s-o)) mybutton.records[3]=r; + if(!strncmp(o,"idle",s-o)) {mybutton.records[0]=r;o=s+1;} + else if(!strncmp(o,"shape",s-o)) {mybutton.records[0]=r;o=s+1;} + else if(!strncmp(o,"hover",s-o)) {mybutton.records[1]=r;o=s+1;} + else if(!strncmp(o,"pressed",s-o)) {mybutton.records[2]=r;o=s+1;} + else if(!strncmp(o,"area",s-o)) {mybutton.records[3]=r;o=s+1;} else syntaxerror("unknown \"as\" argument: \"%s\"", strdup_n(o,s-o)); } if(!*s) @@ -760,7 +760,7 @@ void s_box(char*name, int width, int height, RGBA color, int linewidth, char*tex r2.ymin = 0; r2.xmax = width; r2.ymax = height; - tag = swf_InsertTag(tag, ST_DEFINESHAPE); + tag = swf_InsertTag(tag, ST_DEFINESHAPE3); swf_ShapeNew(&s); ls1 = swf_ShapeAddLineStyle(s,linewidth,&color); @@ -798,7 +798,7 @@ void s_filled(char*name, char*outlinename, RGBA color, int linewidth, char*textu } r2 = outline->bbox; - tag = swf_InsertTag(tag, ST_DEFINESHAPE); + tag = swf_InsertTag(tag, ST_DEFINESHAPE3); swf_ShapeNew(&s); ls1 = swf_ShapeAddLineStyle(s,linewidth,&color); if(texture) @@ -830,7 +830,7 @@ void s_circle(char*name, int r, RGBA color, int linewidth, char*texture) r2.xmax = 2*r; r2.ymax = 2*r; - tag = swf_InsertTag(tag, ST_DEFINESHAPE); + tag = swf_InsertTag(tag, ST_DEFINESHAPE3); swf_ShapeNew(&s); ls1 = swf_ShapeAddLineStyle(s,linewidth,&color); if(texture) @@ -1021,6 +1021,8 @@ void s_font(char*name, char*filename) font->layout = 0; swf_FontCreateLayout(font); } + /* just in case this thing is used in .edittext later on */ + swf_FontPrepareForEditText(font); font->id = id; tag = swf_InsertTag(tag, ST_DEFINEFONT2); @@ -2435,7 +2437,7 @@ static int c_edittext(map_t*args) //"name font size width height text="" color=black maxlength=0 variable="" @password=0 @wordwrap=0 @multiline=0 @html=0 @noselect=0 @readonly=0"}, char*name = lu(args, "name"); char*font = lu(args, "font"); - int size = (int)(100*20*parsePercent(lu(args, "size"))); + int size = (int)(1024*parsePercent(lu(args, "size"))); int width = parseTwip(lu(args, "width")); int height = parseTwip(lu(args, "height")); char*text = lu(args, "text");