From 7ae38c1292669b111cd7c0f21188d76a8f246cac Mon Sep 17 00:00:00 2001 From: Embin <113154360+NotEmbin@users.noreply.github.com> Date: Wed, 15 Oct 2025 15:29:56 -0700 Subject: [PATCH 1/4] this change is grand --- src/extensions/jwVector/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/extensions/jwVector/index.js b/src/extensions/jwVector/index.js index 00a11c9261b..0ddddbd8010 100644 --- a/src/extensions/jwVector/index.js +++ b/src/extensions/jwVector/index.js @@ -340,7 +340,7 @@ class Extension { ], menus: { roundingFunctions: { - acceptReporters: false, + acceptReporters: true, items: [ { text: 'round', @@ -462,9 +462,11 @@ class Extension { return new VectorType(Math.floor(v.x), Math.floor(v.y)) case 'ceil': return new VectorType(Math.ceil(v.x), Math.ceil(v.y)) + case 'round': + return new VectorType(Math.round(v.x), Math.round(v.y)) } - return new VectorType(Math.round(v.x), Math.round(v.y)) + return new VectorType(0, 0) } getPos({}, util) { From 193bba0fea2189b3b721f05cae18292a31ce4261 Mon Sep 17 00:00:00 2001 From: Embin <113154360+NotEmbin@users.noreply.github.com> Date: Wed, 15 Oct 2025 15:32:04 -0700 Subject: [PATCH 2/4] maybe return itself instead of 0,0 vector --- src/extensions/jwVector/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/jwVector/index.js b/src/extensions/jwVector/index.js index 0ddddbd8010..579752b9487 100644 --- a/src/extensions/jwVector/index.js +++ b/src/extensions/jwVector/index.js @@ -466,7 +466,7 @@ class Extension { return new VectorType(Math.round(v.x), Math.round(v.y)) } - return new VectorType(0, 0) + return v; } getPos({}, util) { From 6df847625dba825baba4b523154d82e576f0b2a6 Mon Sep 17 00:00:00 2001 From: Embin <113154360+NotEmbin@users.noreply.github.com> Date: Wed, 15 Oct 2025 15:38:56 -0700 Subject: [PATCH 3/4] be consistent, brah --- src/extensions/jwVector/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/jwVector/index.js b/src/extensions/jwVector/index.js index 579752b9487..102e4ef3c55 100644 --- a/src/extensions/jwVector/index.js +++ b/src/extensions/jwVector/index.js @@ -466,7 +466,7 @@ class Extension { return new VectorType(Math.round(v.x), Math.round(v.y)) } - return v; + return v } getPos({}, util) { From 7fce0a8cc59d23a3564c4bc7799f1684b54809bd Mon Sep 17 00:00:00 2001 From: Embin <113154360+NotEmbin@users.noreply.github.com> Date: Sat, 8 Nov 2025 12:29:33 -0800 Subject: [PATCH 4/4] backwards FFFFFFFFFFFFF --- src/extensions/jwVector/index.js | 35 +++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/extensions/jwVector/index.js b/src/extensions/jwVector/index.js index bfac975b080..086d3812c5f 100644 --- a/src/extensions/jwVector/index.js +++ b/src/extensions/jwVector/index.js @@ -287,6 +287,7 @@ class Extension { { opcode: 'round', text: '[ROUNDING] of [VECTOR]', + hideFromPalette: true, arguments: { ROUNDING: { menu: 'roundingFunctions', @@ -295,6 +296,17 @@ class Extension { }, ...Vector.Block }, + { + opcode: 'roundNew', + text: '[ROUNDING] of [VECTOR]', + arguments: { + ROUNDING: { + menu: 'roundingFunctionsAcceptReporters', + }, + VECTOR: Vector.Argument + }, + ...Vector.Block + }, "---", { opcode: 'getPos', @@ -339,7 +351,7 @@ class Extension { ], menus: { roundingFunctions: { - acceptReporters: true, + acceptReporters: false, items: [ { text: 'round', @@ -355,6 +367,23 @@ class Extension { } ] }, + roundingFunctionsAcceptReporters: { // needs to be separate to not break old projects + acceptReporters: true, + items: [ + { + text: 'round', + value: 'round' + }, + { + text: 'ceil', + value: 'ceil' + }, + { + text: 'floor', + value: 'floor' + } + ] + }, } }; } @@ -467,6 +496,10 @@ class Extension { return v } + + roundNew(args) { + return this.round(args) + } getPos({}, util) { return new Vector.Type(