mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 05:39:18 +01:00
Merge branch 'master' of github.com:processing/processing
This commit is contained in:
@@ -5825,12 +5825,19 @@ public class PApplet implements PConstants {
|
||||
return saveXML(xml, filename, null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @nowebref
|
||||
*/
|
||||
public boolean saveXML(XML xml, String filename, String options) {
|
||||
return xml.save(saveFile(filename), options);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @webref input:files
|
||||
* @param input String to parse as a JSONObject
|
||||
* @see PApplet#loadJSONObject(String)
|
||||
* @see PApplet#saveJSONObject(JSONObject, String)
|
||||
*/
|
||||
public JSONObject parseJSONObject(String input) {
|
||||
return new JSONObject(new StringReader(input));
|
||||
}
|
||||
@@ -5867,12 +5874,20 @@ public class PApplet implements PConstants {
|
||||
return saveJSONObject(json, filename, null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @nowebref
|
||||
*/
|
||||
public boolean saveJSONObject(JSONObject json, String filename, String options) {
|
||||
return json.save(saveFile(filename), options);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @webref input:files
|
||||
* @param input String to parse as a JSONArray
|
||||
* @see JSONObject
|
||||
* @see PApplet#loadJSONObject(String)
|
||||
* @see PApplet#saveJSONObject(JSONObject, String)
|
||||
*/
|
||||
public JSONArray parseJSONArray(String input) {
|
||||
return new JSONArray(new StringReader(input));
|
||||
}
|
||||
@@ -5881,7 +5896,6 @@ public class PApplet implements PConstants {
|
||||
/**
|
||||
* @webref input:files
|
||||
* @param filename name of a file in the data folder or a URL
|
||||
* @see JSONObject
|
||||
* @see JSONArray
|
||||
* @see PApplet#loadJSONObject(String)
|
||||
* @see PApplet#saveJSONObject(JSONObject, String)
|
||||
|
||||
@@ -942,8 +942,10 @@ public class PSurfaceJOGL implements PSurface {
|
||||
|
||||
int peCount = 0;
|
||||
if (peAction == MouseEvent.WHEEL) {
|
||||
peCount = nativeEvent.isShiftDown() ? (int)nativeEvent.getRotation()[0] :
|
||||
(int)nativeEvent.getRotation()[1];
|
||||
// Invert wheel rotation count so it matches JAVA2D's
|
||||
// https://github.com/processing/processing/issues/3840
|
||||
peCount = -(nativeEvent.isShiftDown() ? (int)nativeEvent.getRotation()[0]:
|
||||
(int)nativeEvent.getRotation()[1]);
|
||||
} else {
|
||||
peCount = nativeEvent.getClickCount();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user