Beispiel #1
0
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;
}
Beispiel #2
0
/*
 * set line width and line color
 *
 * set line width in TWIPS
 * set line color as {r, g, b, a}
 *
 * WARNING: this is an internal interface.
 * external use is deprecated! use setLine instead !
 */
void
SWFShape_setLineStyle_internal(SWFShape shape, unsigned short width,
                               byte r, byte g, byte b, byte a)
{
    int line;

    if ( shape->isEnded )
        return;

    for ( line=0; line<shape->nLines; ++line )
    {
        if ( SWFLineStyle_equals(shape->lines[line], width, r, g, b, a, 0) )
            break;
    }

    if ( line == shape->nLines )
        line = SWFShape_addLineStyle(shape, width, r, g, b, a);
    else
        ++line;

    finishSetLine(shape, line, width);
}