@@ -9663,7 +9663,7 @@ public void frameResized(int w, int h) {
9663
9663
9664
9664
// WINDOW METHODS
9665
9665
9666
- Map<String, Integer > windowEventQueue = new ConcurrentHashMap<>();
9666
+ Map<String, WindowEventValuePairs > windowEventQueue = new ConcurrentHashMap<>();
9667
9667
9668
9668
9669
9669
public void windowTitle(String title) {
@@ -9683,8 +9683,7 @@ public void windowResize(int newWidth, int newHeight) {
9683
9683
* only the notification that the resize has happened.
9684
9684
*/
9685
9685
public void postWindowResized(int newWidth, int newHeight) {
9686
- windowEventQueue.put("w", newWidth);
9687
- windowEventQueue.put("h", newHeight);
9686
+ windowEventQueue.put("wh", new WindowEventValuePairs(newWidth, newHeight));
9688
9687
}
9689
9688
9690
9689
@@ -9724,8 +9723,7 @@ public void postWindowMoved(int newX, int newY) {
9724
9723
frameMoved(newX, newY);
9725
9724
}
9726
9725
9727
- windowEventQueue.put("x", newX);
9728
- windowEventQueue.put("y", newY);
9726
+ windowEventQueue.put("xy", new WindowEventValuePairs(newX, newY));
9729
9727
}
9730
9728
9731
9729
@@ -9734,21 +9732,28 @@ public void windowMoved() { }
9734
9732
9735
9733
9736
9734
private void dequeueWindowEvents() {
9737
- if (windowEventQueue.containsKey("x")) {
9738
- windowX = windowEventQueue.remove("x");
9739
- windowY = windowEventQueue.remove("y");
9735
+ if (windowEventQueue.containsKey("xy")) {
9736
+ WindowEventValuePairs xy = windowEventQueue.remove("xy");
9737
+ windowX = xy.num1;
9738
+ windowY = xy.num2;
9740
9739
windowMoved();
9741
9740
}
9742
- if (windowEventQueue.containsKey("w")) {
9743
- // these should already match width/height
9744
- //windowResized(windowEventQueue.remove("w"),
9745
- // windowEventQueue.remove("h"));
9746
- windowEventQueue.remove("w");
9747
- windowEventQueue.remove("h");
9741
+ if (windowEventQueue.containsKey("wh")) {
9742
+ WindowEventValuePairs wh = windowEventQueue.remove("wh");
9748
9743
windowResized();
9749
9744
}
9750
9745
}
9751
9746
9747
+ protected class WindowEventValuePairs {
9748
+
9749
+ public int num1;
9750
+ public int num2;
9751
+
9752
+ public WindowEventValuePairs(int num1, int num2) {
9753
+ this.num1 = num1;
9754
+ this.num2 = num2;
9755
+ }
9756
+ }
9752
9757
9753
9758
/**
9754
9759
* Scale the sketch as if it fits this specific width and height.
0 commit comments