diff --git a/src/webgl/ShaderGenerator.js b/src/webgl/ShaderGenerator.js index d029ed44ef..9f355e59d0 100644 --- a/src/webgl/ShaderGenerator.js +++ b/src/webgl/ShaderGenerator.js @@ -521,24 +521,29 @@ function shadergenerator(p5, fn) { class FunctionCallNode extends BaseNode { constructor(name, userArgs, properties, isInternal = false) { let functionSignature; - const determineFunctionSignature = (props) => { + const determineFunctionSignature = (props, userArgs) => { let genType; let similarity = 0; const valid = userArgs.every((userArg, i) => { const userType = getType(userArg); let expectedArgType = props.args[i]; - + let coercedUserType = userType; if (expectedArgType === 'genType') { - // We allow conversions from float -> vec if one argument is a vector. - if (genType === undefined || (genType === 'float' && userType.startsWith('vec'))) { - genType = userType - }; + if (userType === 'int') coercedUserType = 'float'; + if (!validGenTypes.includes(coercedUserType)) return false; + + if (genType === undefined) { + genType = coercedUserType; + } + expectedArgType = genType; } similarity += (userType === expectedArgType); return userType === expectedArgType || (userType === 'float' && expectedArgType.startsWith('vec')); }) + console.log('userArgs:', userArgs); + console.log('props.args:', props.args); return { ...props, valid, similarity, genType } } diff --git a/test/unit/io/loadTable.js b/test/unit/io/loadTable.js index 171d12f7c3..f00e78cdce 100644 --- a/test/unit/io/loadTable.js +++ b/test/unit/io/loadTable.js @@ -84,6 +84,7 @@ suite('loadTable', function() { // TODO: Current parsing does not handle quoted fields const table = await mockP5Prototype.loadTable(validFile); assert.equal(table.getRowCount(), 4); - assert.equal(table.getRow(3).get(0), 'David,\nSr. "the boss"'); + const value = table.getRow(3).get(0).replace(/\r\n/g, '\n'); + assert.equal(value, 'David,\nSr. "the boss"'); }); }); diff --git a/test/unit/visual/screenshots/Typography/textFont/with the default monospace font/000.png b/test/unit/visual/screenshots/Typography/textFont/with the default monospace font/000.png index a88804ae71..12203ca667 100644 Binary files a/test/unit/visual/screenshots/Typography/textFont/with the default monospace font/000.png and b/test/unit/visual/screenshots/Typography/textFont/with the default monospace font/000.png differ diff --git a/test/unit/visual/screenshots/Typography/textWeight/can control non-variable fonts/000.png b/test/unit/visual/screenshots/Typography/textWeight/can control non-variable fonts/000.png index 87dcda79df..21fd22f1ea 100644 Binary files a/test/unit/visual/screenshots/Typography/textWeight/can control non-variable fonts/000.png and b/test/unit/visual/screenshots/Typography/textWeight/can control non-variable fonts/000.png differ diff --git a/test/unit/visual/screenshots/Typography/textWeight/can control non-variable fonts/001.png b/test/unit/visual/screenshots/Typography/textWeight/can control non-variable fonts/001.png index 786f2a8b71..fdd97786e5 100644 Binary files a/test/unit/visual/screenshots/Typography/textWeight/can control non-variable fonts/001.png and b/test/unit/visual/screenshots/Typography/textWeight/can control non-variable fonts/001.png differ