From 34889590e6c3a6ad507ac4fcc437225881815d71 Mon Sep 17 00:00:00 2001 From: mathuramg Date: Thu, 16 Aug 2018 12:34:46 -0400 Subject: [PATCH 1/2] remove keyword arguments --- dist/p5.accessibility.js | 155 ++++++++++---------- examples/ExampleStyled/app.js | 3 +- src/entities/_baseEntity.js | 14 +- src/entities/backgroundEntity.js | 11 +- src/entities/fillEntity.js | 11 +- src/entities/shapeEntity.js | 56 +++---- src/entities/textEntity.js | 16 +- src/gridInterceptor/interceptorFunctions.js | 12 +- src/gridInterceptor/interceptorP5.js | 8 +- src/soundInterceptor/interceptorP5.js | 6 +- src/textInterceptor/interceptorFunctions.js | 12 +- src/textInterceptor/interceptorP5.js | 8 +- 12 files changed, 159 insertions(+), 153 deletions(-) diff --git a/dist/p5.accessibility.js b/dist/p5.accessibility.js index 6abee27..d476bd2 100644 --- a/dist/p5.accessibility.js +++ b/dist/p5.accessibility.js @@ -1139,14 +1139,14 @@ function RGBString(arguments) { }) }; - this.getLocation = function(object, arguments, canvasX, canvasY) { // eslint-disable-line + this.getLocation = function(object, locArgs, canvasX, canvasY) { // eslint-disable-line let xCoord, yCoord; - arguments = [].slice.call(arguments); + locArgs = [].slice.call(locArgs); let i = 0; const that = this; that.coordinates = ``; - arguments.forEach((argument) => { + locArgs.forEach((argument) => { const a = argument; if (object.params[i].description.indexOf(`x-coordinate`) > -1) { xCoord = a; @@ -1186,14 +1186,14 @@ function RGBString(arguments) { } /* return which part of the canvas an object os present */ - this.canvasLocator = function(object, arguments, canvasX, canvasY) { + this.canvasLocator = function(object, canvasArgs, canvasX, canvasY) { let xCoord, yCoord; const noRows = 10, noCols = 10; let locX, locY; let i = 0; - arguments = [].slice.call(arguments); - arguments.forEach((argument) => { + canvasArgs = [].slice.call(canvasArgs); + canvasArgs.forEach((argument) => { const a = argument; if (object.params[i].description.indexOf(`x-coordinate`) > -1) { @@ -1219,13 +1219,13 @@ function RGBString(arguments) { } } -BaseEntity.isParameter = false;;function BackgroundEntity(Interceptor, object, arguments, canvasX, canvasY) { - let passedArguments = arguments; +BaseEntity.isParameter = false; +;function BackgroundEntity(Interceptor, object, backgroundArgs, canvasX, canvasY) { this.populate = function(Interceptor) { - if (passedArguments[0].name === `p5.Color`) { - passedArguments = passedArguments[0].levels; + if (backgroundArgs[0].name === `p5.Color`) { + backgroundArgs = backgroundArgs[0].levels; } - Interceptor.bgColor = Interceptor.getColorName(passedArguments).color + Interceptor.getColorName(passedArguments).rgb; + Interceptor.bgColor = Interceptor.getColorName(backgroundArgs).color + Interceptor.getColorName(backgroundArgs).rgb; } this.populate(Interceptor); @@ -1241,13 +1241,13 @@ BackgroundEntity.handles = function(name) { BackgroundEntity.isParameter = true; /* global Registry */ -Registry.register(BackgroundEntity);;function FillEntity(Interceptor, shapeObject, arguments, canvasX, canvasY) { - let passedArguments = arguments; +Registry.register(BackgroundEntity); +;function FillEntity(Interceptor, shapeObject, fillArgs, canvasX, canvasY) {fillArgs; this.populate = function(Interceptor) { - if (passedArguments[0].name === `p5.Color`) { - passedArguments = passedArguments[0].levels; + if (fillArgs[0].name === `p5.Color`) { + fillArgs = fillArgs[0].levels; } - Interceptor.currentColor = Interceptor.getColorName(passedArguments).color + Interceptor.getColorName(passedArguments).rgb; + Interceptor.currentColor = Interceptor.getColorName(fillArgs).color + Interceptor.getColorName(fillArgs).rgb; } this.populate(Interceptor); @@ -1263,19 +1263,20 @@ FillEntity.handles = function(name) { FillEntity.isParameter = true; /* global Registry */ -Registry.register(FillEntity);;function ShapeEntity(Interceptor, shapeObject, arguments, canvasX, canvasY) { +Registry.register(FillEntity); +;function ShapeEntity(Interceptor, shapeObject, shapeArgs, canvasX, canvasY) { const self = this; /* global BaseEntity */ - BaseEntity.call(self, shapeObject, arguments, canvasX, canvasY); + BaseEntity.call(self, shapeObject, shapeArgs, canvasX, canvasY); this.areaAbs = 0; this.type = Interceptor.currentColor + ` ` + shapeObject.name; this.area = 0; - this.populate = function(shapeObject, arguments, canvasX, canvasY) { - this.location = this.getLocation(shapeObject, arguments, canvasX, canvasY); - this.areaAbs = this.getObjectArea(shapeObject.name, arguments); - this.coordLoc = this.canvasLocator(shapeObject, arguments, canvasX, canvasY); - this.area = (this.getObjectArea(shapeObject.name, arguments) * 100 / (canvasX * canvasY)).toFixed(2) + `%`; + this.populate = function(shapeObject, shapeArgs, canvasX, canvasY) { + this.location = this.getLocation(shapeObject, shapeArgs, canvasX, canvasY); + this.areaAbs = this.getObjectArea(shapeObject.name, shapeArgs); + this.coordLoc = this.canvasLocator(shapeObject, shapeArgs, canvasX, canvasY); + this.area = (this.getObjectArea(shapeObject.name, shapeArgs) * 100 / (canvasX * canvasY)).toFixed(2) + `%`; } this.getAttributes = function() { @@ -1288,23 +1289,23 @@ Registry.register(FillEntity);;function ShapeEntity(Interceptor, shapeObject, ar }; /* return area of the shape */ - this.getObjectArea = function(objectType, arguments) { + this.getObjectArea = function(objectType, shapeArgs) { let objectArea = 0; if (!objectType.localeCompare(`arc`)) { // area of full ellipse = PI * horizontal radius * vertical radius. // therefore, area of arc = difference bet. arc's start and end radians * horizontal radius * vertical radius. - // the below expression is adjusted for negative values and differences in arc's start and end radians over PI*2 - const arcSizeInRadians = ((((arguments[5] - arguments[4]) % (PI * 2)) + (PI * 2)) % (PI * 2)); - objectArea = arcSizeInRadians * arguments[2] * arguments[3] / 8; - if (arguments[6] === `open` || arguments[6] === `chord`) { + // the below expression is adjusted for negative values and differences in arc's start and end radians over PI*2 + const arcSizeInRadians = ((((shapeArgs[5] - shapeArgs[4]) % (PI * 2)) + (PI * 2)) % (PI * 2)); + objectArea = arcSizeInRadians * shapeArgs[2] * shapeArgs[3] / 8; + if (shapeArgs[6] === `open` || shapeArgs[6] === `chord`) { // when the arc's mode is OPEN or CHORD, we need to account for the area of the triangle that is formed to close the arc // (Ax( By − Cy) + Bx(Cy − Ay) + Cx(Ay − By ) )/2 - const Ax = arguments[0]; - const Ay = arguments[1]; - const Bx = arguments[0] + (arguments[2] / 2) * cos(arguments[4]).toFixed(2); - const By = arguments[1] + (arguments[3] / 2) * sin(arguments[4]).toFixed(2); - const Cx = arguments[0] + (arguments[2] / 2) * cos(arguments[5]).toFixed(2); - const Cy = arguments[1] + (arguments[3] / 2) * sin(arguments[5]).toFixed(2); + const Ax = shapeArgs[0]; + const Ay = shapeArgs[1]; + const Bx = shapeArgs[0] + (shapeArgs[2] / 2) * cos(shapeArgs[4]).toFixed(2); + const By = shapeArgs[1] + (shapeArgs[3] / 2) * sin(shapeArgs[4]).toFixed(2); + const Cx = shapeArgs[0] + (shapeArgs[2] / 2) * cos(shapeArgs[5]).toFixed(2); + const Cy = shapeArgs[1] + (shapeArgs[3] / 2) * sin(shapeArgs[5]).toFixed(2); const areaOfExtraTriangle = abs(Ax * (By - Cy) + Bx * (Cy - Ay) + Cx * (Ay - By)) / 2; if (arcSizeInRadians > PI) { objectArea = objectArea + areaOfExtraTriangle; @@ -1313,28 +1314,28 @@ Registry.register(FillEntity);;function ShapeEntity(Interceptor, shapeObject, ar } } } else if (!objectType.localeCompare(`ellipse`)) { - objectArea = 3.14 * arguments[2] * arguments[3] / 4; + objectArea = 3.14 * shapeArgs[2] * shapeArgs[3] / 4; } else if (!objectType.localeCompare(`line`)) { objectArea = 0; } else if (!objectType.localeCompare(`point`)) { objectArea = 0; } else if (!objectType.localeCompare(`quad`)) { // x1y2+x2y3+x3y4+x4y1−x2y1−x3y2−x4y3−x1y4 - objectArea = (arguments[0] * arguments[1] + arguments[2] * arguments[3] + - arguments[4] * arguments[5] + arguments[6] * arguments[7]) - - (arguments[2] * arguments[1] + arguments[4] * arguments[3] + - arguments[6] * arguments[5] + arguments[0] * arguments[7]); + objectArea = (shapeArgs[0] * shapeArgs[1] + shapeArgs[2] * shapeArgs[3] + + shapeArgs[4] * shapeArgs[5] + shapeArgs[6] * shapeArgs[7]) - + (shapeArgs[2] * shapeArgs[1] + shapeArgs[4] * shapeArgs[3] + + shapeArgs[6] * shapeArgs[5] + shapeArgs[0] * shapeArgs[7]); } else if (!objectType.localeCompare(`rect`)) { - objectArea = arguments[2] * arguments[3]; + objectArea = shapeArgs[2] * shapeArgs[3]; } else if (!objectType.localeCompare(`triangle`)) { - objectArea = abs(arguments[0] * (arguments[3] - arguments[5]) + arguments[2] * (arguments[5] - arguments[1]) + - arguments[4] * (arguments[1] - arguments[3])) / 2; + objectArea = abs(shapeArgs[0] * (shapeArgs[3] - shapeArgs[5]) + shapeArgs[2] * (shapeArgs[5] - shapeArgs[1]) + + shapeArgs[4] * (shapeArgs[1] - shapeArgs[3])) / 2; // (Ax( By − Cy) + Bx(Cy − Ay) + Cx(Ay − By ))/2 } return objectArea; } - this.populate(shapeObject, arguments, canvasX, canvasY); + this.populate(shapeObject, shapeArgs, canvasX, canvasY); } ShapeEntity.handledNames = [ @@ -1354,15 +1355,16 @@ ShapeEntity.handles = function(name) { ShapeEntity.isParameter = false; /* global Registry */ -Registry.register(ShapeEntity);;function TextEntity(Interceptor, shapeObject, arguments, canvasX, canvasY) { +Registry.register(ShapeEntity); +;function TextEntity(Interceptor, shapeObject, textArgs, canvasX, canvasY) { const self = this; /* global BaseEntity */ - BaseEntity.call(self, shapeObject, arguments, canvasX, canvasY); - this.type = String(arguments[0]).substring(0, 20) + `(` + Interceptor.currentColor + `)`; + BaseEntity.call(self, shapeObject, textArgs, canvasX, canvasY); + this.type = String(textArgs[0]).substring(0, 20) + `(` + Interceptor.currentColor + `)`; - this.populate = function(shapeObject, arguments, canvasX, canvasY) { - this.location = this.getLocation(shapeObject, arguments, canvasX, canvasY); - this.coordLoc = this.canvasLocator(shapeObject, arguments, canvasX, canvasY); + this.populate = function(shapeObject, textArgs, canvasX, canvasY) { + this.location = this.getLocation(shapeObject, textArgs, canvasX, canvasY); + this.coordLoc = this.canvasLocator(shapeObject, textArgs, canvasX, canvasY); }; this.getAttributes = function() { @@ -1373,7 +1375,7 @@ Registry.register(ShapeEntity);;function TextEntity(Interceptor, shapeObject, ar }) }; - this.populate(shapeObject, arguments, canvasX, canvasY); + this.populate(shapeObject, textArgs, canvasX, canvasY); } TextEntity.handledNames = [ @@ -1387,7 +1389,8 @@ TextEntity.handles = function(name) { TextEntity.isParameter = false; /* global Registry */ -Registry.register(TextEntity);;function TextInterceptor() { // eslint-disable-line +Registry.register(TextEntity); +;function TextInterceptor() { // eslint-disable-line const self = this; /* global baseInterceptor */ baseInterceptor.call(self); @@ -1402,7 +1405,7 @@ TextInterceptor.prototype.clearVariables = function(object) { return object; } -TextInterceptor.prototype.populateObject = function(x, arguments, object, table, isDraw) { +TextInterceptor.prototype.populateObject = function(x, passedArgs, object, table, isDraw) { /* global objectCount */ objectCount = object.objectCount; /* global objectArray */ @@ -1412,15 +1415,15 @@ TextInterceptor.prototype.populateObject = function(x, arguments, object, table, if (!isDraw) { // check for special function in setup -> createCanvas if (!x.name.localeCompare(`createCanvas`)) { - this.canvasDetails.width = arguments[0]; - this.canvasDetails.height = arguments[1]; + this.canvasDetails.width = passedArgs[0]; + this.canvasDetails.height = passedArgs[1]; } } /* global Registry */ const entityClass = Registry.entityFor(x.name); if (entityClass && !entityClass.isParameter) { - objectArray[objectCount] = new entityClass(this, x, arguments, this.canvasDetails.width, this.canvasDetails.height); + objectArray[objectCount] = new entityClass(this, x, passedArgs, this.canvasDetails.width, this.canvasDetails.height); if (objectTypeCount[x.name]) { objectTypeCount[x.name]++; @@ -1429,7 +1432,7 @@ TextInterceptor.prototype.populateObject = function(x, arguments, object, table, } objectCount++; } else if (entityClass && entityClass.isParameter) { - new entityClass(this, x, arguments, this.canvasDetails.width, this.canvasDetails.height); + new entityClass(this, x, passedArgs, this.canvasDetails.width, this.canvasDetails.height); } return ({ objectCount, @@ -1600,7 +1603,8 @@ TextInterceptor.prototype.getSummary = function(object1, object2, element) { } } -const textInterceptor = new TextInterceptor();;/* global funcNames */ +const textInterceptor = new TextInterceptor(); +;/* global funcNames */ /* global allData */ funcNames = allData.classitems.map((x) => { if (x.overloads) { @@ -1642,7 +1646,7 @@ if (document.getElementById(`textOutput-content`)) { details.innerHTML = ``; summary.innerHTML = ``; /* global textInterceptor */ - textInterceptor.setupObject = textInterceptor.populateObject(x, arguments, textInterceptor.setupObject, table, false); + textInterceptor.setupObject = textInterceptor.populateObject(x, orgArg, textInterceptor.setupObject, table, false); textInterceptor.getSummary(textInterceptor.setupObject, textInterceptor.drawObject, summary); textInterceptor.populateTable(table, textInterceptor.setupObject.objectArray); } else if (frameCount % 20 === 19) { @@ -1650,16 +1654,17 @@ if (document.getElementById(`textOutput-content`)) { textInterceptor.drawObject = textInterceptor.clearVariables(textInterceptor.drawObject); } } else if (frameCount === 1 || frameCount % 20 === 0) { - textInterceptor.drawObject = textInterceptor.populateObject(x, arguments, textInterceptor.drawObject, details, true); + textInterceptor.drawObject = textInterceptor.populateObject(x, orgArg, textInterceptor.drawObject, details, true); textInterceptor.getSummary(textInterceptor.setupObject, textInterceptor.drawObject, summary); textInterceptor.populateTable( table, textInterceptor.setupObject.objectArray.concat(textInterceptor.drawObject.objectArray)); } - return originalFunc.apply(this, arguments); + return originalFunc.apply(this, orgArg); }; }); -};var shadowDOMElement; // eslint-disable-line +} +;var shadowDOMElement; // eslint-disable-line function GridInterceptor() { const self = this; /* global baseInterceptor */ @@ -1694,7 +1699,7 @@ GridInterceptor.prototype.createShadowDOMElement = function(document) { } shadowDOMElement = document.getElementById(`tableOutput-content`); } -GridInterceptor.prototype.populateObject = function(x, arguments, object, table, isDraw) { +GridInterceptor.prototype.populateObject = function(x, passedArgs, object, table, isDraw) { /* global objectCount */ objectCount = object.objectCount; /* global objectArray */ @@ -1704,15 +1709,15 @@ GridInterceptor.prototype.populateObject = function(x, arguments, object, table, if (!isDraw) { // check for special function in setup -> createCanvas if (!x.name.localeCompare(`createCanvas`)) { - this.canvasDetails.width = arguments[0]; - this.canvasDetails.height = arguments[1]; + this.canvasDetails.width = passedArgs[0]; + this.canvasDetails.height = passedArgs[1]; } } /* global Registry */ const entityClass = Registry.entityFor(x.name); if (entityClass && !entityClass.isParameter) { - objectArray[objectCount] = new entityClass(this, x, arguments, this.canvasDetails.width, this.canvasDetails.height); + objectArray[objectCount] = new entityClass(this, x, passedArgs, this.canvasDetails.width, this.canvasDetails.height); if (objectTypeCount[x.name]) { objectTypeCount[x.name]++; @@ -1721,7 +1726,7 @@ GridInterceptor.prototype.populateObject = function(x, arguments, object, table, } objectCount++; } else if (entityClass && entityClass.isParameter) { - new entityClass(this, x, arguments, this.canvasDetails.width, this.canvasDetails.height); + new entityClass(this, x, passedArgs, this.canvasDetails.width, this.canvasDetails.height); } return ({ objectCount, @@ -1811,7 +1816,8 @@ GridInterceptor.prototype.populateObjectDetails = function(object1, object2, ele } -const gridInterceptor = new GridInterceptor();;/* global funcNames */ +const gridInterceptor = new GridInterceptor(); +;/* global funcNames */ /* global allData */ funcNames = allData.classitems.map((x) => { if (x.overloads) { @@ -1856,12 +1862,12 @@ if (document.getElementById(`tableOutput-content`)) { /* global gridInterceptor */ gridInterceptor.createShadowDOMElement(document); gridInterceptor.setupObject = - gridInterceptor.populateObject(x, arguments, gridInterceptor.setupObject, details, false); + gridInterceptor.populateObject(x, orgArg, gridInterceptor.setupObject, details, false); gridInterceptor.populateObjectDetails(gridInterceptor.setupObject, gridInterceptor.drawObject, summary, details); gridInterceptor.populateTable(details, gridInterceptor.setupObject); } else if (frameCount === 1 || frameCount % 20 === 0) { gridInterceptor.drawObject = - gridInterceptor.populateObject(x, arguments, gridInterceptor.drawObject, details, true); + gridInterceptor.populateObject(x, orgArg, gridInterceptor.drawObject, details, true); gridInterceptor.isCleared = false; // clean the cells @@ -1881,10 +1887,11 @@ if (document.getElementById(`tableOutput-content`)) { if (x.name === `redraw`) { // reset some of the variables gridInterceptor.drawObject = gridInterceptor.clearVariables(gridInterceptor.drawObject); } - return originalFunc.apply(this, arguments); + return originalFunc.apply(this, orgArg); }; }); -};const baseFreq = 440; +} +;const baseFreq = 440; let currLogFreq, currVol, currPan; // initialise parameters @@ -1929,7 +1936,7 @@ if (document.getElementById(`soundOutput-content`)) { const originalFunc = p5.prototype[x.name]; p5.prototype[x.name] = function() { /* global orgArg */ - orgArg = arguments; + const orgArg = arguments; if (frameCount === 1 && (x.module.localeCompare(`Shape`) === 0)) { i = 0; @@ -2020,7 +2027,7 @@ if (document.getElementById(`soundOutput-content`)) { gainNodes[movingObjectCount - 1].gain.value = 0; } } - return originalFunc.apply(this, arguments); + return originalFunc.apply(this, orgArg); }; }); -} \ No newline at end of file +} diff --git a/examples/ExampleStyled/app.js b/examples/ExampleStyled/app.js index 1355893..6d96ab6 100644 --- a/examples/ExampleStyled/app.js +++ b/examples/ExampleStyled/app.js @@ -13,7 +13,7 @@ function draw() { ellipse(20,20,20,20); fill(32,255,65); ellipse(50,x,10,10); - fill("#00ffb2"); + fill(`#00ffb2`); ellipse(150,200-x,10,10); fill(150); rect(170,170,25,25); @@ -21,4 +21,5 @@ function draw() { if(x>200 || x < 0) { speed = -speed; } + text(`potato`,100,100) } diff --git a/src/entities/_baseEntity.js b/src/entities/_baseEntity.js index 1957bda..c1e980b 100644 --- a/src/entities/_baseEntity.js +++ b/src/entities/_baseEntity.js @@ -14,14 +14,14 @@ function BaseEntity(Interceptor, object) { }) }; - this.getLocation = function(object, arguments, canvasX, canvasY) { // eslint-disable-line + this.getLocation = function(object, locArgs, canvasX, canvasY) { // eslint-disable-line let xCoord, yCoord; - arguments = [].slice.call(arguments); + locArgs = [].slice.call(locArgs); let i = 0; const that = this; that.coordinates = ``; - arguments.forEach((argument) => { + locArgs.forEach((argument) => { const a = argument; if (object.params[i].description.indexOf(`x-coordinate`) > -1) { xCoord = a; @@ -61,14 +61,14 @@ function BaseEntity(Interceptor, object) { } /* return which part of the canvas an object os present */ - this.canvasLocator = function(object, arguments, canvasX, canvasY) { + this.canvasLocator = function(object, canvasArgs, canvasX, canvasY) { let xCoord, yCoord; const noRows = 10, noCols = 10; let locX, locY; let i = 0; - arguments = [].slice.call(arguments); - arguments.forEach((argument) => { + canvasArgs = [].slice.call(canvasArgs); + canvasArgs.forEach((argument) => { const a = argument; if (object.params[i].description.indexOf(`x-coordinate`) > -1) { @@ -94,4 +94,4 @@ function BaseEntity(Interceptor, object) { } } -BaseEntity.isParameter = false; \ No newline at end of file +BaseEntity.isParameter = false; diff --git a/src/entities/backgroundEntity.js b/src/entities/backgroundEntity.js index 06d40a2..d9cacb6 100644 --- a/src/entities/backgroundEntity.js +++ b/src/entities/backgroundEntity.js @@ -1,10 +1,9 @@ -function BackgroundEntity(Interceptor, object, arguments, canvasX, canvasY) { - let passedArguments = arguments; +function BackgroundEntity(Interceptor, object, backgroundArgs, canvasX, canvasY) { this.populate = function(Interceptor) { - if (passedArguments[0].name === `p5.Color`) { - passedArguments = passedArguments[0].levels; + if (backgroundArgs[0].name === `p5.Color`) { + backgroundArgs = backgroundArgs[0].levels; } - Interceptor.bgColor = Interceptor.getColorName(passedArguments).color + Interceptor.getColorName(passedArguments).rgb; + Interceptor.bgColor = Interceptor.getColorName(backgroundArgs).color + Interceptor.getColorName(backgroundArgs).rgb; } this.populate(Interceptor); @@ -20,4 +19,4 @@ BackgroundEntity.handles = function(name) { BackgroundEntity.isParameter = true; /* global Registry */ -Registry.register(BackgroundEntity); \ No newline at end of file +Registry.register(BackgroundEntity); diff --git a/src/entities/fillEntity.js b/src/entities/fillEntity.js index f58374b..2f82449 100644 --- a/src/entities/fillEntity.js +++ b/src/entities/fillEntity.js @@ -1,10 +1,9 @@ -function FillEntity(Interceptor, shapeObject, arguments, canvasX, canvasY) { - let passedArguments = arguments; +function FillEntity(Interceptor, shapeObject, fillArgs, canvasX, canvasY) {fillArgs; this.populate = function(Interceptor) { - if (passedArguments[0].name === `p5.Color`) { - passedArguments = passedArguments[0].levels; + if (fillArgs[0].name === `p5.Color`) { + fillArgs = fillArgs[0].levels; } - Interceptor.currentColor = Interceptor.getColorName(passedArguments).color + Interceptor.getColorName(passedArguments).rgb; + Interceptor.currentColor = Interceptor.getColorName(fillArgs).color + Interceptor.getColorName(fillArgs).rgb; } this.populate(Interceptor); @@ -20,4 +19,4 @@ FillEntity.handles = function(name) { FillEntity.isParameter = true; /* global Registry */ -Registry.register(FillEntity); \ No newline at end of file +Registry.register(FillEntity); diff --git a/src/entities/shapeEntity.js b/src/entities/shapeEntity.js index b412463..c86a229 100644 --- a/src/entities/shapeEntity.js +++ b/src/entities/shapeEntity.js @@ -1,16 +1,16 @@ -function ShapeEntity(Interceptor, shapeObject, arguments, canvasX, canvasY) { +function ShapeEntity(Interceptor, shapeObject, shapeArgs, canvasX, canvasY) { const self = this; /* global BaseEntity */ - BaseEntity.call(self, shapeObject, arguments, canvasX, canvasY); + BaseEntity.call(self, shapeObject, shapeArgs, canvasX, canvasY); this.areaAbs = 0; this.type = Interceptor.currentColor + ` ` + shapeObject.name; this.area = 0; - this.populate = function(shapeObject, arguments, canvasX, canvasY) { - this.location = this.getLocation(shapeObject, arguments, canvasX, canvasY); - this.areaAbs = this.getObjectArea(shapeObject.name, arguments); - this.coordLoc = this.canvasLocator(shapeObject, arguments, canvasX, canvasY); - this.area = (this.getObjectArea(shapeObject.name, arguments) * 100 / (canvasX * canvasY)).toFixed(2) + `%`; + this.populate = function(shapeObject, shapeArgs, canvasX, canvasY) { + this.location = this.getLocation(shapeObject, shapeArgs, canvasX, canvasY); + this.areaAbs = this.getObjectArea(shapeObject.name, shapeArgs); + this.coordLoc = this.canvasLocator(shapeObject, shapeArgs, canvasX, canvasY); + this.area = (this.getObjectArea(shapeObject.name, shapeArgs) * 100 / (canvasX * canvasY)).toFixed(2) + `%`; } this.getAttributes = function() { @@ -23,23 +23,23 @@ function ShapeEntity(Interceptor, shapeObject, arguments, canvasX, canvasY) { }; /* return area of the shape */ - this.getObjectArea = function(objectType, arguments) { + this.getObjectArea = function(objectType, shapeArgs) { let objectArea = 0; if (!objectType.localeCompare(`arc`)) { // area of full ellipse = PI * horizontal radius * vertical radius. // therefore, area of arc = difference bet. arc's start and end radians * horizontal radius * vertical radius. - // the below expression is adjusted for negative values and differences in arc's start and end radians over PI*2 - const arcSizeInRadians = ((((arguments[5] - arguments[4]) % (PI * 2)) + (PI * 2)) % (PI * 2)); - objectArea = arcSizeInRadians * arguments[2] * arguments[3] / 8; - if (arguments[6] === `open` || arguments[6] === `chord`) { + // the below expression is adjusted for negative values and differences in arc's start and end radians over PI*2 + const arcSizeInRadians = ((((shapeArgs[5] - shapeArgs[4]) % (PI * 2)) + (PI * 2)) % (PI * 2)); + objectArea = arcSizeInRadians * shapeArgs[2] * shapeArgs[3] / 8; + if (shapeArgs[6] === `open` || shapeArgs[6] === `chord`) { // when the arc's mode is OPEN or CHORD, we need to account for the area of the triangle that is formed to close the arc // (Ax( By − Cy) + Bx(Cy − Ay) + Cx(Ay − By ) )/2 - const Ax = arguments[0]; - const Ay = arguments[1]; - const Bx = arguments[0] + (arguments[2] / 2) * cos(arguments[4]).toFixed(2); - const By = arguments[1] + (arguments[3] / 2) * sin(arguments[4]).toFixed(2); - const Cx = arguments[0] + (arguments[2] / 2) * cos(arguments[5]).toFixed(2); - const Cy = arguments[1] + (arguments[3] / 2) * sin(arguments[5]).toFixed(2); + const Ax = shapeArgs[0]; + const Ay = shapeArgs[1]; + const Bx = shapeArgs[0] + (shapeArgs[2] / 2) * cos(shapeArgs[4]).toFixed(2); + const By = shapeArgs[1] + (shapeArgs[3] / 2) * sin(shapeArgs[4]).toFixed(2); + const Cx = shapeArgs[0] + (shapeArgs[2] / 2) * cos(shapeArgs[5]).toFixed(2); + const Cy = shapeArgs[1] + (shapeArgs[3] / 2) * sin(shapeArgs[5]).toFixed(2); const areaOfExtraTriangle = abs(Ax * (By - Cy) + Bx * (Cy - Ay) + Cx * (Ay - By)) / 2; if (arcSizeInRadians > PI) { objectArea = objectArea + areaOfExtraTriangle; @@ -48,28 +48,28 @@ function ShapeEntity(Interceptor, shapeObject, arguments, canvasX, canvasY) { } } } else if (!objectType.localeCompare(`ellipse`)) { - objectArea = 3.14 * arguments[2] * arguments[3] / 4; + objectArea = 3.14 * shapeArgs[2] * shapeArgs[3] / 4; } else if (!objectType.localeCompare(`line`)) { objectArea = 0; } else if (!objectType.localeCompare(`point`)) { objectArea = 0; } else if (!objectType.localeCompare(`quad`)) { // x1y2+x2y3+x3y4+x4y1−x2y1−x3y2−x4y3−x1y4 - objectArea = (arguments[0] * arguments[1] + arguments[2] * arguments[3] + - arguments[4] * arguments[5] + arguments[6] * arguments[7]) - - (arguments[2] * arguments[1] + arguments[4] * arguments[3] + - arguments[6] * arguments[5] + arguments[0] * arguments[7]); + objectArea = (shapeArgs[0] * shapeArgs[1] + shapeArgs[2] * shapeArgs[3] + + shapeArgs[4] * shapeArgs[5] + shapeArgs[6] * shapeArgs[7]) - + (shapeArgs[2] * shapeArgs[1] + shapeArgs[4] * shapeArgs[3] + + shapeArgs[6] * shapeArgs[5] + shapeArgs[0] * shapeArgs[7]); } else if (!objectType.localeCompare(`rect`)) { - objectArea = arguments[2] * arguments[3]; + objectArea = shapeArgs[2] * shapeArgs[3]; } else if (!objectType.localeCompare(`triangle`)) { - objectArea = abs(arguments[0] * (arguments[3] - arguments[5]) + arguments[2] * (arguments[5] - arguments[1]) + - arguments[4] * (arguments[1] - arguments[3])) / 2; + objectArea = abs(shapeArgs[0] * (shapeArgs[3] - shapeArgs[5]) + shapeArgs[2] * (shapeArgs[5] - shapeArgs[1]) + + shapeArgs[4] * (shapeArgs[1] - shapeArgs[3])) / 2; // (Ax( By − Cy) + Bx(Cy − Ay) + Cx(Ay − By ))/2 } return objectArea; } - this.populate(shapeObject, arguments, canvasX, canvasY); + this.populate(shapeObject, shapeArgs, canvasX, canvasY); } ShapeEntity.handledNames = [ @@ -89,4 +89,4 @@ ShapeEntity.handles = function(name) { ShapeEntity.isParameter = false; /* global Registry */ -Registry.register(ShapeEntity); \ No newline at end of file +Registry.register(ShapeEntity); diff --git a/src/entities/textEntity.js b/src/entities/textEntity.js index b3cf75f..e63fb4c 100644 --- a/src/entities/textEntity.js +++ b/src/entities/textEntity.js @@ -1,12 +1,12 @@ -function TextEntity(Interceptor, shapeObject, arguments, canvasX, canvasY) { +function TextEntity(Interceptor, shapeObject, textArgs, canvasX, canvasY) { const self = this; /* global BaseEntity */ - BaseEntity.call(self, shapeObject, arguments, canvasX, canvasY); - this.type = String(arguments[0]).substring(0, 20) + `(` + Interceptor.currentColor + `)`; + BaseEntity.call(self, shapeObject, textArgs, canvasX, canvasY); + this.type = String(textArgs[0]).substring(0, 20) + `(` + Interceptor.currentColor + `)`; - this.populate = function(shapeObject, arguments, canvasX, canvasY) { - this.location = this.getLocation(shapeObject, arguments, canvasX, canvasY); - this.coordLoc = this.canvasLocator(shapeObject, arguments, canvasX, canvasY); + this.populate = function(shapeObject, textArgs, canvasX, canvasY) { + this.location = this.getLocation(shapeObject, textArgs, canvasX, canvasY); + this.coordLoc = this.canvasLocator(shapeObject, textArgs, canvasX, canvasY); }; this.getAttributes = function() { @@ -17,7 +17,7 @@ function TextEntity(Interceptor, shapeObject, arguments, canvasX, canvasY) { }) }; - this.populate(shapeObject, arguments, canvasX, canvasY); + this.populate(shapeObject, textArgs, canvasX, canvasY); } TextEntity.handledNames = [ @@ -31,4 +31,4 @@ TextEntity.handles = function(name) { TextEntity.isParameter = false; /* global Registry */ -Registry.register(TextEntity); \ No newline at end of file +Registry.register(TextEntity); diff --git a/src/gridInterceptor/interceptorFunctions.js b/src/gridInterceptor/interceptorFunctions.js index a441208..568b61b 100644 --- a/src/gridInterceptor/interceptorFunctions.js +++ b/src/gridInterceptor/interceptorFunctions.js @@ -33,7 +33,7 @@ GridInterceptor.prototype.createShadowDOMElement = function(document) { } shadowDOMElement = document.getElementById(`tableOutput-content`); } -GridInterceptor.prototype.populateObject = function(x, arguments, object, table, isDraw) { +GridInterceptor.prototype.populateObject = function(x, passedArgs, object, table, isDraw) { /* global objectCount */ objectCount = object.objectCount; /* global objectArray */ @@ -43,15 +43,15 @@ GridInterceptor.prototype.populateObject = function(x, arguments, object, table, if (!isDraw) { // check for special function in setup -> createCanvas if (!x.name.localeCompare(`createCanvas`)) { - this.canvasDetails.width = arguments[0]; - this.canvasDetails.height = arguments[1]; + this.canvasDetails.width = passedArgs[0]; + this.canvasDetails.height = passedArgs[1]; } } /* global Registry */ const entityClass = Registry.entityFor(x.name); if (entityClass && !entityClass.isParameter) { - objectArray[objectCount] = new entityClass(this, x, arguments, this.canvasDetails.width, this.canvasDetails.height); + objectArray[objectCount] = new entityClass(this, x, passedArgs, this.canvasDetails.width, this.canvasDetails.height); if (objectTypeCount[x.name]) { objectTypeCount[x.name]++; @@ -60,7 +60,7 @@ GridInterceptor.prototype.populateObject = function(x, arguments, object, table, } objectCount++; } else if (entityClass && entityClass.isParameter) { - new entityClass(this, x, arguments, this.canvasDetails.width, this.canvasDetails.height); + new entityClass(this, x, passedArgs, this.canvasDetails.width, this.canvasDetails.height); } return ({ objectCount, @@ -150,4 +150,4 @@ GridInterceptor.prototype.populateObjectDetails = function(object1, object2, ele } -const gridInterceptor = new GridInterceptor(); \ No newline at end of file +const gridInterceptor = new GridInterceptor(); diff --git a/src/gridInterceptor/interceptorP5.js b/src/gridInterceptor/interceptorP5.js index 84f1432..31e1727 100644 --- a/src/gridInterceptor/interceptorP5.js +++ b/src/gridInterceptor/interceptorP5.js @@ -43,12 +43,12 @@ if (document.getElementById(`tableOutput-content`)) { /* global gridInterceptor */ gridInterceptor.createShadowDOMElement(document); gridInterceptor.setupObject = - gridInterceptor.populateObject(x, arguments, gridInterceptor.setupObject, details, false); + gridInterceptor.populateObject(x, orgArg, gridInterceptor.setupObject, details, false); gridInterceptor.populateObjectDetails(gridInterceptor.setupObject, gridInterceptor.drawObject, summary, details); gridInterceptor.populateTable(details, gridInterceptor.setupObject); } else if (frameCount === 1 || frameCount % 20 === 0) { gridInterceptor.drawObject = - gridInterceptor.populateObject(x, arguments, gridInterceptor.drawObject, details, true); + gridInterceptor.populateObject(x, orgArg, gridInterceptor.drawObject, details, true); gridInterceptor.isCleared = false; // clean the cells @@ -68,7 +68,7 @@ if (document.getElementById(`tableOutput-content`)) { if (x.name === `redraw`) { // reset some of the variables gridInterceptor.drawObject = gridInterceptor.clearVariables(gridInterceptor.drawObject); } - return originalFunc.apply(this, arguments); + return originalFunc.apply(this, orgArg); }; }); -} \ No newline at end of file +} diff --git a/src/soundInterceptor/interceptorP5.js b/src/soundInterceptor/interceptorP5.js index fcd10e4..7f690e9 100644 --- a/src/soundInterceptor/interceptorP5.js +++ b/src/soundInterceptor/interceptorP5.js @@ -43,7 +43,7 @@ if (document.getElementById(`soundOutput-content`)) { const originalFunc = p5.prototype[x.name]; p5.prototype[x.name] = function() { /* global orgArg */ - orgArg = arguments; + const orgArg = arguments; if (frameCount === 1 && (x.module.localeCompare(`Shape`) === 0)) { i = 0; @@ -134,7 +134,7 @@ if (document.getElementById(`soundOutput-content`)) { gainNodes[movingObjectCount - 1].gain.value = 0; } } - return originalFunc.apply(this, arguments); + return originalFunc.apply(this, orgArg); }; }); -} \ No newline at end of file +} diff --git a/src/textInterceptor/interceptorFunctions.js b/src/textInterceptor/interceptorFunctions.js index 680ab3b..0a9528b 100644 --- a/src/textInterceptor/interceptorFunctions.js +++ b/src/textInterceptor/interceptorFunctions.js @@ -13,7 +13,7 @@ TextInterceptor.prototype.clearVariables = function(object) { return object; } -TextInterceptor.prototype.populateObject = function(x, arguments, object, table, isDraw) { +TextInterceptor.prototype.populateObject = function(x, passedArgs, object, table, isDraw) { /* global objectCount */ objectCount = object.objectCount; /* global objectArray */ @@ -23,15 +23,15 @@ TextInterceptor.prototype.populateObject = function(x, arguments, object, table, if (!isDraw) { // check for special function in setup -> createCanvas if (!x.name.localeCompare(`createCanvas`)) { - this.canvasDetails.width = arguments[0]; - this.canvasDetails.height = arguments[1]; + this.canvasDetails.width = passedArgs[0]; + this.canvasDetails.height = passedArgs[1]; } } /* global Registry */ const entityClass = Registry.entityFor(x.name); if (entityClass && !entityClass.isParameter) { - objectArray[objectCount] = new entityClass(this, x, arguments, this.canvasDetails.width, this.canvasDetails.height); + objectArray[objectCount] = new entityClass(this, x, passedArgs, this.canvasDetails.width, this.canvasDetails.height); if (objectTypeCount[x.name]) { objectTypeCount[x.name]++; @@ -40,7 +40,7 @@ TextInterceptor.prototype.populateObject = function(x, arguments, object, table, } objectCount++; } else if (entityClass && entityClass.isParameter) { - new entityClass(this, x, arguments, this.canvasDetails.width, this.canvasDetails.height); + new entityClass(this, x, passedArgs, this.canvasDetails.width, this.canvasDetails.height); } return ({ objectCount, @@ -211,4 +211,4 @@ TextInterceptor.prototype.getSummary = function(object1, object2, element) { } } -const textInterceptor = new TextInterceptor(); \ No newline at end of file +const textInterceptor = new TextInterceptor(); diff --git a/src/textInterceptor/interceptorP5.js b/src/textInterceptor/interceptorP5.js index c523b6c..5fe4475 100644 --- a/src/textInterceptor/interceptorP5.js +++ b/src/textInterceptor/interceptorP5.js @@ -40,7 +40,7 @@ if (document.getElementById(`textOutput-content`)) { details.innerHTML = ``; summary.innerHTML = ``; /* global textInterceptor */ - textInterceptor.setupObject = textInterceptor.populateObject(x, arguments, textInterceptor.setupObject, table, false); + textInterceptor.setupObject = textInterceptor.populateObject(x, orgArg, textInterceptor.setupObject, table, false); textInterceptor.getSummary(textInterceptor.setupObject, textInterceptor.drawObject, summary); textInterceptor.populateTable(table, textInterceptor.setupObject.objectArray); } else if (frameCount % 20 === 19) { @@ -48,13 +48,13 @@ if (document.getElementById(`textOutput-content`)) { textInterceptor.drawObject = textInterceptor.clearVariables(textInterceptor.drawObject); } } else if (frameCount === 1 || frameCount % 20 === 0) { - textInterceptor.drawObject = textInterceptor.populateObject(x, arguments, textInterceptor.drawObject, details, true); + textInterceptor.drawObject = textInterceptor.populateObject(x, orgArg, textInterceptor.drawObject, details, true); textInterceptor.getSummary(textInterceptor.setupObject, textInterceptor.drawObject, summary); textInterceptor.populateTable( table, textInterceptor.setupObject.objectArray.concat(textInterceptor.drawObject.objectArray)); } - return originalFunc.apply(this, arguments); + return originalFunc.apply(this, orgArg); }; }); -} \ No newline at end of file +} From 0df0c0dcb1a14ea2696ed10bed06f3e5957dc34c Mon Sep 17 00:00:00 2001 From: mathuramg Date: Sun, 19 Aug 2018 17:29:52 -0400 Subject: [PATCH 2/2] remove lint errors --- dist/p5.accessibility.js | 13 +++++++------ examples/ExampleStyled/app.js | 1 - src/entities/backgroundEntity.js | 2 +- src/entities/fillEntity.js | 3 ++- src/gridInterceptor/interceptorFunctions.js | 2 +- src/gridInterceptor/interceptorP5.js | 2 +- src/textInterceptor/interceptorFunctions.js | 2 +- src/textInterceptor/interceptorP5.js | 2 +- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/dist/p5.accessibility.js b/dist/p5.accessibility.js index d476bd2..0554000 100644 --- a/dist/p5.accessibility.js +++ b/dist/p5.accessibility.js @@ -1220,7 +1220,7 @@ function RGBString(arguments) { } BaseEntity.isParameter = false; -;function BackgroundEntity(Interceptor, object, backgroundArgs, canvasX, canvasY) { +;function BackgroundEntity(Interceptor, object, backgroundArgs, canvasX, canvasY) { // eslint-disable-line no-unused-vars this.populate = function(Interceptor) { if (backgroundArgs[0].name === `p5.Color`) { backgroundArgs = backgroundArgs[0].levels; @@ -1242,7 +1242,8 @@ BackgroundEntity.isParameter = true; /* global Registry */ Registry.register(BackgroundEntity); -;function FillEntity(Interceptor, shapeObject, fillArgs, canvasX, canvasY) {fillArgs; +;function FillEntity(Interceptor, shapeObject, fillArgs, canvasX, canvasY) // eslint-disable-line no-unused-vars +{ this.populate = function(Interceptor) { if (fillArgs[0].name === `p5.Color`) { fillArgs = fillArgs[0].levels; @@ -1405,7 +1406,7 @@ TextInterceptor.prototype.clearVariables = function(object) { return object; } -TextInterceptor.prototype.populateObject = function(x, passedArgs, object, table, isDraw) { +TextInterceptor.prototype.populateObject = function(x, passedArgs, object, isDraw) { /* global objectCount */ objectCount = object.objectCount; /* global objectArray */ @@ -1646,7 +1647,7 @@ if (document.getElementById(`textOutput-content`)) { details.innerHTML = ``; summary.innerHTML = ``; /* global textInterceptor */ - textInterceptor.setupObject = textInterceptor.populateObject(x, orgArg, textInterceptor.setupObject, table, false); + textInterceptor.setupObject = textInterceptor.populateObject(x, orgArg, textInterceptor.setupObject, false); textInterceptor.getSummary(textInterceptor.setupObject, textInterceptor.drawObject, summary); textInterceptor.populateTable(table, textInterceptor.setupObject.objectArray); } else if (frameCount % 20 === 19) { @@ -1699,7 +1700,7 @@ GridInterceptor.prototype.createShadowDOMElement = function(document) { } shadowDOMElement = document.getElementById(`tableOutput-content`); } -GridInterceptor.prototype.populateObject = function(x, passedArgs, object, table, isDraw) { +GridInterceptor.prototype.populateObject = function(x, passedArgs, object, isDraw) { /* global objectCount */ objectCount = object.objectCount; /* global objectArray */ @@ -1862,7 +1863,7 @@ if (document.getElementById(`tableOutput-content`)) { /* global gridInterceptor */ gridInterceptor.createShadowDOMElement(document); gridInterceptor.setupObject = - gridInterceptor.populateObject(x, orgArg, gridInterceptor.setupObject, details, false); + gridInterceptor.populateObject(x, orgArg, gridInterceptor.setupObject, false); gridInterceptor.populateObjectDetails(gridInterceptor.setupObject, gridInterceptor.drawObject, summary, details); gridInterceptor.populateTable(details, gridInterceptor.setupObject); } else if (frameCount === 1 || frameCount % 20 === 0) { diff --git a/examples/ExampleStyled/app.js b/examples/ExampleStyled/app.js index 6d96ab6..4c6a905 100644 --- a/examples/ExampleStyled/app.js +++ b/examples/ExampleStyled/app.js @@ -21,5 +21,4 @@ function draw() { if(x>200 || x < 0) { speed = -speed; } - text(`potato`,100,100) } diff --git a/src/entities/backgroundEntity.js b/src/entities/backgroundEntity.js index d9cacb6..09d27f7 100644 --- a/src/entities/backgroundEntity.js +++ b/src/entities/backgroundEntity.js @@ -1,4 +1,4 @@ -function BackgroundEntity(Interceptor, object, backgroundArgs, canvasX, canvasY) { +function BackgroundEntity(Interceptor, object, backgroundArgs, canvasX, canvasY) { // eslint-disable-line no-unused-vars this.populate = function(Interceptor) { if (backgroundArgs[0].name === `p5.Color`) { backgroundArgs = backgroundArgs[0].levels; diff --git a/src/entities/fillEntity.js b/src/entities/fillEntity.js index 2f82449..df7b994 100644 --- a/src/entities/fillEntity.js +++ b/src/entities/fillEntity.js @@ -1,4 +1,5 @@ -function FillEntity(Interceptor, shapeObject, fillArgs, canvasX, canvasY) {fillArgs; +function FillEntity(Interceptor, shapeObject, fillArgs, canvasX, canvasY) // eslint-disable-line no-unused-vars +{ this.populate = function(Interceptor) { if (fillArgs[0].name === `p5.Color`) { fillArgs = fillArgs[0].levels; diff --git a/src/gridInterceptor/interceptorFunctions.js b/src/gridInterceptor/interceptorFunctions.js index 568b61b..2b5c947 100644 --- a/src/gridInterceptor/interceptorFunctions.js +++ b/src/gridInterceptor/interceptorFunctions.js @@ -33,7 +33,7 @@ GridInterceptor.prototype.createShadowDOMElement = function(document) { } shadowDOMElement = document.getElementById(`tableOutput-content`); } -GridInterceptor.prototype.populateObject = function(x, passedArgs, object, table, isDraw) { +GridInterceptor.prototype.populateObject = function(x, passedArgs, object, isDraw) { /* global objectCount */ objectCount = object.objectCount; /* global objectArray */ diff --git a/src/gridInterceptor/interceptorP5.js b/src/gridInterceptor/interceptorP5.js index 31e1727..30cd8da 100644 --- a/src/gridInterceptor/interceptorP5.js +++ b/src/gridInterceptor/interceptorP5.js @@ -43,7 +43,7 @@ if (document.getElementById(`tableOutput-content`)) { /* global gridInterceptor */ gridInterceptor.createShadowDOMElement(document); gridInterceptor.setupObject = - gridInterceptor.populateObject(x, orgArg, gridInterceptor.setupObject, details, false); + gridInterceptor.populateObject(x, orgArg, gridInterceptor.setupObject, false); gridInterceptor.populateObjectDetails(gridInterceptor.setupObject, gridInterceptor.drawObject, summary, details); gridInterceptor.populateTable(details, gridInterceptor.setupObject); } else if (frameCount === 1 || frameCount % 20 === 0) { diff --git a/src/textInterceptor/interceptorFunctions.js b/src/textInterceptor/interceptorFunctions.js index 0a9528b..80427f4 100644 --- a/src/textInterceptor/interceptorFunctions.js +++ b/src/textInterceptor/interceptorFunctions.js @@ -13,7 +13,7 @@ TextInterceptor.prototype.clearVariables = function(object) { return object; } -TextInterceptor.prototype.populateObject = function(x, passedArgs, object, table, isDraw) { +TextInterceptor.prototype.populateObject = function(x, passedArgs, object, isDraw) { /* global objectCount */ objectCount = object.objectCount; /* global objectArray */ diff --git a/src/textInterceptor/interceptorP5.js b/src/textInterceptor/interceptorP5.js index 5fe4475..5b29c79 100644 --- a/src/textInterceptor/interceptorP5.js +++ b/src/textInterceptor/interceptorP5.js @@ -40,7 +40,7 @@ if (document.getElementById(`textOutput-content`)) { details.innerHTML = ``; summary.innerHTML = ``; /* global textInterceptor */ - textInterceptor.setupObject = textInterceptor.populateObject(x, orgArg, textInterceptor.setupObject, table, false); + textInterceptor.setupObject = textInterceptor.populateObject(x, orgArg, textInterceptor.setupObject, false); textInterceptor.getSummary(textInterceptor.setupObject, textInterceptor.drawObject, summary); textInterceptor.populateTable(table, textInterceptor.setupObject.objectArray); } else if (frameCount % 20 === 19) {