Bug 1227 : PDF library matrix is not reset between frames
Last modified: 2010-06-05 10:42




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P2
Severity:
normal

 

Reporter:
fjen
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2009-04-09 00:46
in a multiframe pdf export using beginrecord - endrecord the matrix / transforms are not
reset in between frames causing drawings to run offscreen. this is different from the normal
behaviour of draw() where you can assume the transforms are reset to default when it's
entered.


a workaround is to put pushmatrix / popmatrix around any transforms in draw():

import processing.pdf.*;

float rt = 0.0;
float sk = 2.0;

void setup ()
{
size( 800, 800 );
background(255);
beginRecord( PDF, "new.pdf" );
rectMode( CENTER );
}

void draw ()
{
//pushMatrix();

translate( width/2, height/2 );

rotate( rt );
rt += 0.2;

scale( sk );
sk -= 0.1;

rect( 0,0, 200, 200 );

if ( sk < 1 )
{
endRecord();
noLoop();
}

//popMatrix();
}

F
Additional Comment #1 From fry 2009-04-09 04:43
k, noted.
Additional Comment #2 From fry 2010-06-05 10:42
fixed for the next release.