Merge branch 'master' of github.com:processing/processing

This commit is contained in:
Ben Fry
2015-09-22 18:04:55 -04:00
2 changed files with 23 additions and 7 deletions

View File

@@ -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)

View File

@@ -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();
}