mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
split out the javafx stuff, clean up misuse of fields
This commit is contained in:
@@ -9799,7 +9799,7 @@ public class PApplet implements PConstants {
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
void frameMoved(int x, int y) {
|
||||
public void frameMoved(int x, int y) {
|
||||
if (!fullScreen) {
|
||||
System.err.println(EXTERNAL_MOVE + " " + x + " " + y);
|
||||
System.err.flush(); // doesn't seem to help or hurt
|
||||
@@ -9807,8 +9807,7 @@ public class PApplet implements PConstants {
|
||||
}
|
||||
|
||||
|
||||
void frameResized(int w, int h) {
|
||||
|
||||
public void frameResized(int w, int h) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -513,7 +513,7 @@ public class PGraphics extends PImage implements PConstants {
|
||||
// float[][] matrixInvStack = new float[MATRIX_STACK_DEPTH][16];
|
||||
// int matrixStackDepth;
|
||||
|
||||
static final int MATRIX_STACK_DEPTH = 32;
|
||||
static final protected int MATRIX_STACK_DEPTH = 32;
|
||||
|
||||
static final protected String ERROR_PUSHMATRIX_OVERFLOW =
|
||||
"Too many calls to pushMatrix().";
|
||||
|
||||
+6
-4
@@ -20,7 +20,7 @@
|
||||
Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package processing.core;
|
||||
package processing.javafx;
|
||||
|
||||
import java.nio.IntBuffer;
|
||||
|
||||
@@ -42,6 +42,8 @@ import javafx.scene.shape.StrokeLineJoin;
|
||||
import javafx.scene.transform.Affine;
|
||||
import javafx.scene.transform.Transform;
|
||||
|
||||
import processing.core.*;
|
||||
|
||||
|
||||
public class PGraphicsFX2D extends PGraphics {
|
||||
GraphicsContext context;
|
||||
@@ -913,7 +915,7 @@ public class PGraphicsFX2D extends PGraphics {
|
||||
cash = new ImageCache(); //who);
|
||||
setCache(who, cash);
|
||||
who.updatePixels(); // mark the whole thing for update
|
||||
who.modified = true;
|
||||
who.setModified();
|
||||
}
|
||||
|
||||
// If image previously was tinted, or the color changed
|
||||
@@ -925,7 +927,7 @@ public class PGraphicsFX2D extends PGraphics {
|
||||
who.updatePixels();
|
||||
}
|
||||
|
||||
if (who.modified) {
|
||||
if (who.isModified()) {
|
||||
if (who.pixels == null) {
|
||||
// This might be a PGraphics that hasn't been drawn to yet.
|
||||
// Can't just bail because the cache has been created above.
|
||||
@@ -933,7 +935,7 @@ public class PGraphicsFX2D extends PGraphics {
|
||||
who.pixels = new int[who.width * who.height];
|
||||
}
|
||||
cash.update(who, tint, tintColor);
|
||||
who.modified = false;
|
||||
who.setModified(false);
|
||||
}
|
||||
|
||||
context.drawImage(((ImageCache) getCache(who)).image,
|
||||
+4
-2
@@ -20,7 +20,7 @@
|
||||
Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package processing.core;
|
||||
package processing.javafx;
|
||||
|
||||
//import java.awt.event.FocusEvent;
|
||||
//import java.awt.event.FocusListener;
|
||||
@@ -50,6 +50,8 @@ import javafx.scene.layout.StackPane;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.stage.WindowEvent;
|
||||
|
||||
import processing.core.*;
|
||||
|
||||
|
||||
public class PSurfaceFX implements PSurface {
|
||||
PApplet sketch;
|
||||
@@ -470,7 +472,7 @@ public class PSurfaceFX implements PSurface {
|
||||
//System.out.println("handle(" + now + ") calling handleDraw()");
|
||||
sketch.handleDraw();
|
||||
|
||||
if (sketch.exitCalled) {
|
||||
if (sketch.exitCalled()) {
|
||||
//sketch.exitActual(); // just calls System.exit()
|
||||
Platform.exit(); // version for safe JavaFX shutdown
|
||||
}
|
||||
Reference in New Issue
Block a user