Esempio n. 1
0
static void
resetBounds(SWFTextField field)
{
	int minX, maxX, minY, maxY;

	SWFRect_getBounds(CHARACTER(field)->bounds, &minX, &maxX, &minY, &maxY);

	minX = -field->padding;
	minY = -field->padding;

	if ( field->width == 0 )
	{
		int width = field->fontHeight*(field->string ? strlen(field->string) : 0);
		maxX = field->padding + width;
	}
	else
		maxX = field->padding + field->width;

	if ( field->fieldHeight == 0 )
	{
		maxY = field->padding + field->fontHeight*field->nLines +
			(field->nLines-1)*field->lineSpacing;
	}
	else
		maxY = field->padding + field->fieldHeight;

	SWFRect_setBounds(CHARACTER(field)->bounds, minX, maxX, minY, maxY);
}
Esempio n. 2
0
/* 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);
    }
}