void SWFShape_setRightFillStyle(SWFShape shape, SWFFillStyle fill) { ShapeRecord record; int idx; if ( shape->isEnded || shape->isMorph ) return; if(fill == NOFILL) { record = addStyleRecord(shape); record.record.stateChange->rightFill = 0; record.record.stateChange->flags |= SWF_SHAPE_FILLSTYLE1FLAG; return; } idx = getFillIdx(shape, fill); if(idx == 0) // fill not present in array { SWFFillStyle_addDependency(fill, (SWFCharacter)shape); if(addFillStyle(shape, fill) < 0) return; idx = getFillIdx(shape, fill); } record = addStyleRecord(shape); record.record.stateChange->rightFill = idx; record.record.stateChange->flags |= SWF_SHAPE_FILLSTYLE1FLAG; }
void SWFShape_setLineStyle(SWFShape shape, unsigned short width, byte r, byte g, byte b, byte a) { ShapeRecord record; int line; if ( shape->isEnded ) return; for ( line=0; line<*shape->nLines; ++line ) { if ( SWFLineStyle_equals((*shape->lines)[line], width, r, g, b, a) ) break; } if ( line == *shape->nLines ) line = SWFShape_addLineStyle(shape, width, r, g, b, a); else ++line; if ( width == 0 ) shape->lineWidth = 0; else shape->lineWidth = (SWFLineStyle_getWidth((*shape->lines)[line-1]) + 1) / 2; if ( shape->isMorph ) return; record = addStyleRecord(shape); record.record.stateChange->line = line; record.record.stateChange->flags |= SWF_SHAPE_LINESTYLEFLAG; }
void SWFShape_hideLine(SWFShape shape) { ShapeRecord record; if ( shape->isEnded ) return; if ( shape->isMorph ) return; record = addStyleRecord(shape); record.record.stateChange->line = 0; record.record.stateChange->flags |= SWF_SHAPE_LINESTYLEFLAG; }
static void finishSetLine(SWFShape shape, int line, unsigned short width) { ShapeRecord record; if ( width == 0 ) shape->lineWidth = 0; else shape->lineWidth = (SWFLineStyle_getWidth(shape->lines[line-1]) + 1) / 2; if ( shape->isMorph ) return; record = addStyleRecord(shape); record.record.stateChange->line = line; record.record.stateChange->flags |= SWF_SHAPE_LINESTYLEFLAG; }
/* move pen relative to shape origin */ void SWFShape_moveScaledPenTo(SWFShape shape, int x, int y) { ShapeRecord record; if ( shape->isEnded ) return; record = addStyleRecord(shape); record.record.stateChange->moveToX = shape->xpos = x; record.record.stateChange->moveToY = shape->ypos = y; record.record.stateChange->flags |= SWF_SHAPE_MOVETOFLAG; if ( shape->nRecords == 0 || (shape->nRecords == 1 && shape->records[0].type == SHAPERECORD_STATECHANGE) ) { SWFRect_setBounds(SWFCharacter_getBounds(CHARACTER(shape)), x, x, y, y); SWFRect_setBounds(shape->edgeBounds, x, x, y, y); } }
void SWFShape_setRightFillStyle(SWFShape shape, SWFFillStyle fill) { ShapeRecord record; if ( shape->isEnded || shape->isMorph ) return; record = addStyleRecord(shape); if ( fill != NOFILL ) { if ( SWFFill_getIdx(fill) > *shape->nFills ) SWF_error("Invalid fill idx"); record.record.stateChange->rightFill = SWFFill_getIdx(fill); } else record.record.stateChange->rightFill = 0; record.record.stateChange->flags |= SWF_SHAPE_FILLSTYLE1FLAG; }