Made an important change that removes some of the mystery in the scaling values. Originally it was using an arbitrary value of 1536x1056 and was scaled at 800 / canvasWidth (???). Now it will be set to the canvas value, which gives the user control over the final resolution of the SVG.
This commit is contained in:
parent
3dfd46bab0
commit
7bc971167b
|
@ -9,8 +9,8 @@
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
width="1536"
|
width="{{WIDTH}}"
|
||||||
height="1056"
|
height="{{HEIGHT}}"
|
||||||
id="svg2985"
|
id="svg2985"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
inkscape:version="0.48.1 r9760">
|
inkscape:version="0.48.1 r9760">
|
||||||
|
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
@ -84,7 +84,7 @@ public class Config {
|
||||||
|
|
||||||
public int canvasWidth = 800;
|
public int canvasWidth = 800;
|
||||||
public int canvasHeight = 600;
|
public int canvasHeight = 600;
|
||||||
public float canvasScalar = 2.0;
|
public float canvasScalar = 1.0;
|
||||||
|
|
||||||
public boolean display = true;
|
public boolean display = true;
|
||||||
public int windowWidth = 800;
|
public int windowWidth = 800;
|
||||||
|
@ -1350,9 +1350,14 @@ void draw () {
|
||||||
FileOutput = loadStrings("header.txt");
|
FileOutput = loadStrings("header.txt");
|
||||||
String rowTemp;
|
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.
|
//Need to get some background on this.
|
||||||
//what are these magic numbers?
|
//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
|
//not centering the image is more controllable
|
||||||
int xOffset = 0; //(int) (1536 - (SVGscale * config.canvasWidth / 2));
|
int xOffset = 0; //(int) (1536 - (SVGscale * config.canvasWidth / 2));
|
||||||
int yOffset = 0; //(int) (1056 - (SVGscale * config.canvasHeight / 2));
|
int yOffset = 0; //(int) (1056 - (SVGscale * config.canvasHeight / 2));
|
||||||
|
|
Loading…
Reference in New Issue