fixed bug in -s invisibletexttofront
[swftools.git] / lib / devices / swf.c
index 48b054a..4f691b6 100644 (file)
@@ -1972,10 +1972,14 @@ static void drawlink(gfxdevice_t*dev, ActionTAG*actions1, ActionTAG*actions2, gf
             swf_ButtonPostProcess(i->tag, 1);
        }
     }
+
     char buf[80];
+    char*buf2 = 0;
     const char* name = 0;
     if(i->config_linknameurl) {
-       name = url;
+        buf2 = malloc(strlen(type)+strlen(url)+2);
+        sprintf(buf2, "%s:%s", type, url);
+        name = buf2;
     } else {
         name = buf;
         sprintf(buf, "button%d", buttonid);
@@ -1997,6 +2001,9 @@ static void drawlink(gfxdevice_t*dev, ActionTAG*actions1, ActionTAG*actions2, gf
     } else {
        swf_ObjectPlace(i->tag, buttonid, getNewDepth(dev),&i->page_matrix,0,(U8*)name);
     }
+
+    if(buf2)
+       free(buf2);
 }
 
       
@@ -3072,11 +3079,12 @@ static void swf_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyph, gfxcolor_t*
            glyph, i->swffont->id, x, y, color->r, color->g, color->b, color->a);
 
     if(color->a == 0 && i->config_invisibletexttofront) {
+       RGBA color2 = *(RGBA*)color;
        if(i->config_flashversion>=8) {
            // use "multiply" blend mode
-           color->a = color->r = color->g = color->b = 255;
+           color2.a = color2.r = color2.g = color2.b = 255;
        }
-       i->topchardata = charbuffer_append(i->topchardata, i->swffont, glyph, x, y, i->current_font_size, *(RGBA*)color, &i->fontmatrix);
+       i->topchardata = charbuffer_append(i->topchardata, i->swffont, glyph, x, y, i->current_font_size, color2, &i->fontmatrix);
     } else {
        i->chardata = charbuffer_append(i->chardata, i->swffont, glyph, x, y, i->current_font_size, *(RGBA*)color, &i->fontmatrix);
     }