We are about to switch to a new forum software. Until then we have removed the registration on this forum.
//given these coordinates for a rectangle (which I will draw with rectmode CORNER)
float layerX = -50;
float layerY = -50;
float layerW = 100;
float layerH = 100;
//and these transformations
translate( 300, 0 );
scale( 12, 1.5 );
scale( .5, .5 );
//which project those coordinates here.
float sx = screenX( layerX, layerY );
float sy = screenY( layerX, layerY );
float sw = screenX( layerX+layerW, layerY+layerH );
float sh = screenY( layerX+layerW, layerY+layerH );
//(this spits out 0, -37.5, 600, 37.5)
println( sx, sy, sw, sh );
//how do I modify the transformation to 'snap' the transformed values to [0, -38, 600, 38], effectively snapping to the pixel (and widening the rectangle)?
Answers
Use round().