diff --git a/header.txt b/header.txt index a8c898e..4c84fdf 100644 --- a/header.txt +++ b/header.txt @@ -9,8 +9,8 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="1536" - height="1056" + width="{{WIDTH}}" + height="{{HEIGHT}}" id="svg2985" version="1.1" inkscape:version="0.48.1 r9760"> diff --git a/stipple_gen.pde b/stipple_gen.pde index da2b7fa..79bdd91 100644 --- a/stipple_gen.pde +++ b/stipple_gen.pde @@ -84,7 +84,7 @@ public class Config { public int canvasWidth = 800; public int canvasHeight = 600; - public float canvasScalar = 2.0; + public float canvasScalar = 1.0; public boolean display = true; public int windowWidth = 800; @@ -1350,9 +1350,14 @@ void draw () { FileOutput = loadStrings("header.txt"); String rowTemp; + for (i = 0; i < FileOutput.length; i++) { + FileOutput[i] = FileOutput[i].replace("{{WIDTH}}", str(config.canvasWidth)); + FileOutput[i] = FileOutput[i].replace("{{HEIGHT}}", str(config.canvasHeight)); + } + //Need to get some background on this. //what are these magic numbers? - float SVGscale = (800.0 / (float) config.canvasHeight); + float SVGscale = 1.0; //(800.0 / (float) config.canvasHeight); //not centering the image is more controllable int xOffset = 0; //(int) (1536 - (SVGscale * config.canvasWidth / 2)); int yOffset = 0; //(int) (1056 - (SVGscale * config.canvasHeight / 2));