diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index b5aa599b9..ce78b4b6c 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -251,7 +251,16 @@ static private void createAndShowGUI(String[] args) { // long t2 = System.currentTimeMillis(); - if (DEBUG || !SingleInstance.alreadyRunning(args)) { + // boolean flag indicating whether to create new server instance or not + boolean createNewInstance = DEBUG || !SingleInstance.alreadyRunning(args); + + // free up resources by terminating the JVM + if(!createNewInstance){ + System.exit(0); + return; + } + + if (createNewInstance) { // Set the look and feel before opening the window try { Platform.setLookAndFeel(); diff --git a/java/libraries/svg/src/processing/svg/PGraphicsSVG.java b/java/libraries/svg/src/processing/svg/PGraphicsSVG.java index 857f5d93a..bd1db7eb0 100644 --- a/java/libraries/svg/src/processing/svg/PGraphicsSVG.java +++ b/java/libraries/svg/src/processing/svg/PGraphicsSVG.java @@ -85,7 +85,7 @@ public void beginDraw() { // Create an instance of the SVG Generator. g2 = new SVGGraphics2D(document); - ((SVGGraphics2D) g2).setSVGCanvasSize(new Dimension(width, height)); + ((SVGGraphics2D) g2).setSVGCanvasSize(new Dimension(width * pixelDensity, height * pixelDensity)); //set the extension handler to allow linear and radial gradients to be exported as svg GradientExtensionHandler gradH = new GradientExtensionHandler();