Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 5, 2018. It is now read-only.

push & popStyle: Adding ellipseMode, imageMode and shapeMode #255

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
110 changes: 58 additions & 52 deletions processing.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
// build script for generating processing.js

var Browser = {
isDomPresent: true,
navigator: navigator,
window: window,
document: document,
ajax: function(url) {
var xhr = new XMLHttpRequest();
xhr.open("GET", url, false);
if (xhr.overrideMimeType) {
xhr.overrideMimeType("text/plain");
}
xhr.setRequestHeader("If-Modified-Since", "Fri, 01 Jan 1960 00:00:00 GMT");
xhr.send(null);
// failed request?
if (xhr.status !== 200 && xhr.status !== 0) { throw ("XMLHttpRequest failed, status code " + xhr.status); }
return xhr.responseText;
}
};

window.Processing = require('./src/')(Browser);

},{"./src/":28}],2:[function(require,module,exports){
module.exports={
"name": "processing-js",
"version": "1.5.2",
"version": "1.6.0",
"author": "Processing.js",
"repository": {
"type": "git",
Expand Down Expand Up @@ -31,7 +55,7 @@ module.exports={
}
}

},{}],2:[function(require,module,exports){
},{}],3:[function(require,module,exports){
/**
* A ObjectIterator is an iterator wrapper for objects. If passed object contains
* the iterator method, the object instance will be replaced by the result returned by
Expand All @@ -57,7 +81,7 @@ module.exports = function ObjectIterator(obj) {
}
};

},{}],3:[function(require,module,exports){
},{}],4:[function(require,module,exports){
/**
* Processing.js environment constants
*/
Expand Down Expand Up @@ -362,7 +386,7 @@ module.exports = {
MAX_LIGHTS: 8
};

},{}],4:[function(require,module,exports){
},{}],5:[function(require,module,exports){
// the logger for print() and println()
module.exports = function PjsConsole(document) {
var e = { BufferMax: 200 },
Expand Down Expand Up @@ -507,7 +531,7 @@ module.exports = function PjsConsole(document) {
return e;
};

},{}],5:[function(require,module,exports){
},{}],6:[function(require,module,exports){
/**
* Processing.js default scope
*/
Expand Down Expand Up @@ -738,7 +762,7 @@ module.exports = function(options) {
return defaultScope;
};

},{}],6:[function(require,module,exports){
},{}],7:[function(require,module,exports){
/**
* Finalise the Processing.js object.
*/
Expand Down Expand Up @@ -1078,7 +1102,7 @@ module.exports = function finalizeProcessing(Processing, options) {
return Processing;
};

},{}],7:[function(require,module,exports){
},{}],8:[function(require,module,exports){
/**
* Returns Java equals() result for two objects. If the first object
* has the "equals" function, it preforms the call of this function.
Expand All @@ -1105,7 +1129,7 @@ module.exports = function virtEquals(obj, other) {
return obj === other;
};

},{}],8:[function(require,module,exports){
},{}],9:[function(require,module,exports){
/**
* Returns Java hashCode() result for the object. If the object has the "hashCode" function,
* it preforms the call of this function. Otherwise it uses/creates the "$id" property,
Expand Down Expand Up @@ -1134,7 +1158,7 @@ module.exports = function virtHashCode(obj, undef) {
return obj.$id;
};

},{}],9:[function(require,module,exports){
},{}],10:[function(require,module,exports){
/**
* An ArrayList stores a variable number of objects.
*
Expand Down Expand Up @@ -1412,7 +1436,7 @@ module.exports = function(options) {
return ArrayList;
};

},{}],10:[function(require,module,exports){
},{}],11:[function(require,module,exports){
module.exports = (function(charMap, undef) {

var Char = function(chr) {
Expand All @@ -1439,7 +1463,7 @@ module.exports = (function(charMap, undef) {
return Char;
}({}));

},{}],11:[function(require,module,exports){
},{}],12:[function(require,module,exports){
/**
* A HashMap stores a collection of objects, each referenced by a key. This is similar to an Array, only
* instead of accessing elements with a numeric index, a String is used. (If you are familiar with
Expand Down Expand Up @@ -1852,7 +1876,7 @@ module.exports = function(options) {
return HashMap;
};

},{}],12:[function(require,module,exports){
},{}],13:[function(require,module,exports){
// module export
module.exports = function(options,undef) {
var window = options.Browser.window,
Expand Down Expand Up @@ -2227,7 +2251,7 @@ module.exports = function(options,undef) {

return PFont;
};
},{}],13:[function(require,module,exports){
},{}],14:[function(require,module,exports){
module.exports = function(options, undef) {

// FIXME: hack
Expand Down Expand Up @@ -2624,7 +2648,7 @@ module.exports = function(options, undef) {
return PMatrix2D;
};

},{}],14:[function(require,module,exports){
},{}],15:[function(require,module,exports){
module.exports = function(options, undef) {

// FIXME: hack
Expand Down Expand Up @@ -3222,7 +3246,7 @@ module.exports = function(options, undef) {

return PMatrix3D;
};
},{}],15:[function(require,module,exports){
},{}],16:[function(require,module,exports){
module.exports = function(options) {
var PConstants = options.PConstants,
PMatrix2D = options.PMatrix2D,
Expand Down Expand Up @@ -3884,7 +3908,7 @@ module.exports = function(options) {

return PShape;
};
},{}],16:[function(require,module,exports){
},{}],17:[function(require,module,exports){
/**
* SVG stands for Scalable Vector Graphics, a portable graphics format. It is
* a vector format so it allows for infinite resolution and relatively small
Expand Down Expand Up @@ -4976,7 +5000,7 @@ module.exports = function(options) {
return PShapeSVG;
};

},{}],17:[function(require,module,exports){
},{}],18:[function(require,module,exports){
module.exports = function(options, undef) {
var PConstants = options.PConstants;

Expand Down Expand Up @@ -5222,7 +5246,7 @@ module.exports = function(options, undef) {
return PVector;
};

},{}],18:[function(require,module,exports){
},{}],19:[function(require,module,exports){
/**
* XMLAttribute is an attribute of a XML element.
*
Expand Down Expand Up @@ -5304,7 +5328,7 @@ module.exports = function() {
return XMLAttribute;
};

},{}],19:[function(require,module,exports){
},{}],20:[function(require,module,exports){
/**
* XMLElement is a representation of an XML object. The object is able to parse XML code
*
Expand Down Expand Up @@ -6112,7 +6136,7 @@ module.exports = function(options, undef) {
return XMLElement;
};

},{}],20:[function(require,module,exports){
},{}],21:[function(require,module,exports){
/**
* web colors, by name
*/
Expand Down Expand Up @@ -6259,7 +6283,7 @@ module.exports = {
yellowgreen: "#9acd32"
};

},{}],21:[function(require,module,exports){
},{}],22:[function(require,module,exports){
module.exports = function(virtHashCode, virtEquals, undef) {

return function withProxyFunctions(p, removeFirstArgument) {
Expand Down Expand Up @@ -6556,7 +6580,7 @@ module.exports = function(virtHashCode, virtEquals, undef) {

};

},{}],22:[function(require,module,exports){
},{}],23:[function(require,module,exports){
/**
* For many "math" functions, we can delegate
* to the Math object. For others, we can't.
Expand Down Expand Up @@ -7246,7 +7270,7 @@ module.exports = function withMath(p, undef) {
};
};

},{}],23:[function(require,module,exports){
},{}],24:[function(require,module,exports){
/**
* Common functions traditionally on "p" that should be class functions
* that get bound to "p" when an instance is actually built, instead.
Expand Down Expand Up @@ -7480,7 +7504,7 @@ module.exports = (function commonFunctions(undef) {
return CommonFunctions;
}());

},{}],24:[function(require,module,exports){
},{}],25:[function(require,module,exports){
/**
* Touch and Mouse event handling
*/
Expand Down Expand Up @@ -7807,7 +7831,7 @@ module.exports = function withTouch(p, curElement, attachEventHandler, document,

};

},{}],25:[function(require,module,exports){
},{}],26:[function(require,module,exports){
/**
* The parser for turning Processing syntax into Pjs JavaScript.
* This code is not trivial; unless you know what you're doing,
Expand Down Expand Up @@ -9553,7 +9577,7 @@ module.exports = function setupParser(Processing, options) {
return Processing;
};

},{"../Helpers/PjsConsole":4}],26:[function(require,module,exports){
},{"../Helpers/PjsConsole":5}],27:[function(require,module,exports){
/**
* Processing.js object
*/
Expand Down Expand Up @@ -13345,6 +13369,9 @@ module.exports = function setupParser(Processing, options) {
'currentStrokeColor': currentStrokeColor,
'curTint': curTint,
'curRectMode': curRectMode,
'curEllipseMode': curEllipseMode,
'curShapeMode' : curShapeMode,
'imageModeConvert': imageModeConvert,
'curColorMode': curColorMode,
'colorModeX': colorModeX,
'colorModeZ': colorModeZ,
Expand Down Expand Up @@ -13388,6 +13415,9 @@ module.exports = function setupParser(Processing, options) {
currentStrokeColor = oldState.currentStrokeColor;
curTint = oldState.curTint;
curRectMode = oldState.curRectMode;
curEllipseMode = oldState.curEllipseMode;
curShapeMode = oldState.curShapeMode;
imageModeConvert = oldState.imageModeConvert;
curColorMode = oldState.curColorMode;
colorModeX = oldState.colorModeX;
colorModeZ = oldState.colorModeZ;
Expand Down Expand Up @@ -21623,7 +21653,7 @@ module.exports = function setupParser(Processing, options) {
return Processing;
};

},{}],27:[function(require,module,exports){
},{}],28:[function(require,module,exports){
// Base source files
var source = {
virtEquals: require("./Helpers/virtEquals"),
Expand Down Expand Up @@ -21757,28 +21787,4 @@ module.exports = function buildProcessingJS(Browser, testHarness) {
return Processing;
};

},{"../package.json":1,"./Helpers/ObjectIterator":2,"./Helpers/PConstants":3,"./Helpers/defaultScope":5,"./Helpers/finalizeProcessing":6,"./Helpers/virtEquals":7,"./Helpers/virtHashCode":8,"./Objects/ArrayList":9,"./Objects/Char":10,"./Objects/HashMap":11,"./Objects/PFont":12,"./Objects/PMatrix2D":13,"./Objects/PMatrix3D":14,"./Objects/PShape":15,"./Objects/PShapeSVG":16,"./Objects/PVector":17,"./Objects/XMLAttribute":18,"./Objects/XMLElement":19,"./Objects/webcolors":20,"./P5Functions/JavaProxyFunctions":21,"./P5Functions/Math.js":22,"./P5Functions/commonFunctions":23,"./P5Functions/touchmouse":24,"./Parser/Parser":25,"./Processing":26}],28:[function(require,module,exports){
// build script for generating processing.js

var Browser = {
isDomPresent: true,
navigator: navigator,
window: window,
document: document,
ajax: function(url) {
var xhr = new XMLHttpRequest();
xhr.open("GET", url, false);
if (xhr.overrideMimeType) {
xhr.overrideMimeType("text/plain");
}
xhr.setRequestHeader("If-Modified-Since", "Fri, 01 Jan 1960 00:00:00 GMT");
xhr.send(null);
// failed request?
if (xhr.status !== 200 && xhr.status !== 0) { throw ("XMLHttpRequest failed, status code " + xhr.status); }
return xhr.responseText;
}
};

window.Processing = require('./src/')(Browser);

},{"./src/":27}]},{},[28]);
},{"../package.json":2,"./Helpers/ObjectIterator":3,"./Helpers/PConstants":4,"./Helpers/defaultScope":6,"./Helpers/finalizeProcessing":7,"./Helpers/virtEquals":8,"./Helpers/virtHashCode":9,"./Objects/ArrayList":10,"./Objects/Char":11,"./Objects/HashMap":12,"./Objects/PFont":13,"./Objects/PMatrix2D":14,"./Objects/PMatrix3D":15,"./Objects/PShape":16,"./Objects/PShapeSVG":17,"./Objects/PVector":18,"./Objects/XMLAttribute":19,"./Objects/XMLElement":20,"./Objects/webcolors":21,"./P5Functions/JavaProxyFunctions":22,"./P5Functions/Math.js":23,"./P5Functions/commonFunctions":24,"./P5Functions/touchmouse":25,"./Parser/Parser":26,"./Processing":27}]},{},[1]);
6 changes: 6 additions & 0 deletions src/Processing.js
Original file line number Diff line number Diff line change
Expand Up @@ -3789,6 +3789,9 @@
'currentStrokeColor': currentStrokeColor,
'curTint': curTint,
'curRectMode': curRectMode,
'curEllipseMode': curEllipseMode,
'curShapeMode' : curShapeMode,
'imageModeConvert': imageModeConvert,
'curColorMode': curColorMode,
'colorModeX': colorModeX,
'colorModeZ': colorModeZ,
Expand Down Expand Up @@ -3832,6 +3835,9 @@
currentStrokeColor = oldState.currentStrokeColor;
curTint = oldState.curTint;
curRectMode = oldState.curRectMode;
curEllipseMode = oldState.curEllipseMode;
curShapeMode = oldState.curShapeMode;
imageModeConvert = oldState.imageModeConvert;
curColorMode = oldState.curColorMode;
colorModeX = oldState.colorModeX;
colorModeZ = oldState.colorModeZ;
Expand Down
13 changes: 13 additions & 0 deletions test/ref/pushPopStyle_ellipseMode.pde

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions test/ref/pushPopStyle_imageMode.pde

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions test/ref/pushPopStyle_shapeMode.pde

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions test/ref/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ var tests = [
{ path: "letters.pde", tags: ["2D", "Text"], epsilonOverride: 0.45 }, /* See ticket #1172 */
{ path: "words.pde", tags: ["2D", "Text"], epsilonOverride: 0.25 }, /* See ticket #1172 */
{ path: "text-pushpopstyle.pde", tags: ["2D", "Text"], epsilonOverride: 0.35 }, /* See ticket #1172 */
{ path: "pushPopStyle_ellipseMode.pde", tags: ["2D"]},
{ path: "pushPopStyle_imageMode.pde", tags: ["2D"]},
{ path: "pushPopStyle_shapeMode.pde", tags: ["2D", "SVG"]},
{ path: "setup-noFill-noStroke.pde", tags: ["2D"]}, /* See ticket #1417 */
{ path: "svg_font_biotyp.pde", tags: ["2D", "Text"] },
{ path: "box-rotating.pde", tags: ["3D"], epsilonOverride: 0.10 },
Expand Down