From 1e5c55f65a8e78f343d5eb721da50fbecde84c57 Mon Sep 17 00:00:00 2001 From: joostdecock Date: Wed, 24 Aug 2022 11:59:57 +0200 Subject: [PATCH] breaking(plugin-gore): Drop `goreNumber` prop Please use `gores` instead. --- plugins/plugin-gore/src/index.js | 16 +++++----------- plugins/plugin-gore/tests/plugin.test.mjs | 10 +++++----- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/plugins/plugin-gore/src/index.js b/plugins/plugin-gore/src/index.js index 0efeb7e72dc..023e90e4c45 100644 --- a/plugins/plugin-gore/src/index.js +++ b/plugins/plugin-gore/src/index.js @@ -1,9 +1,5 @@ import pkg from '../package.json' -const deprecated = - "The 'goreNumber' property for the gore macro is deprecated " + - "and will be removed in a future version. Please use 'gores' instead" - export default { name: pkg.name, version: pkg.version, @@ -12,13 +8,11 @@ export default { }, macros: { gore: function (so) { - let from = so.from - // TODO: Drop so.goreNumber in v3, it's deprecated - let gores = so.gores || so.goreNumber //number of gores for the complete sphere - if (so.goreNumber) console.log(deprecated) - let radius = so.radius //radius of the sphere - let prefix = so.prefix - let extraLength = so.extraLength //the length of the straight section after a complete semisphere + const from = so.from + const gores = so.gores + const radius = so.radius //radius of the sphere + const prefix = so.prefix + const extraLength = so.extraLength //the length of the straight section after a complete semisphere this.points[prefix + 'p1'] = from.shift(0, (radius * Math.PI) / 2 + extraLength) this.points[prefix + 'Cp1'] = this.points[prefix + 'p1'].shift( diff --git a/plugins/plugin-gore/tests/plugin.test.mjs b/plugins/plugin-gore/tests/plugin.test.mjs index 0a8608867ba..5cde9d7b683 100644 --- a/plugins/plugin-gore/tests/plugin.test.mjs +++ b/plugins/plugin-gore/tests/plugin.test.mjs @@ -15,7 +15,7 @@ describe('Gore Plugin Tests', () => { macro('gore', { from:anchorPoint, radius:25, - goreNumber:4, + gores:4, extraLength:0, prefix:'gore' }) @@ -36,7 +36,7 @@ describe('Gore Plugin Tests', () => { macro('gore', { from:anchorPoint, radius:25, - goreNumber:8, + gores:8, extraLength:0, prefix:'gore' }) @@ -58,7 +58,7 @@ describe('Gore Plugin Tests', () => { macro('gore', { from:anchorPoint, radius:25, - goreNumber:4, + gores:4, extraLength:20, prefix:'gore' }) @@ -80,7 +80,7 @@ describe('Gore Plugin Tests', () => { macro('gore', { from:anchorPoint, radius:30, - goreNumber:4, + gores:4, extraLength:0, prefix:'gore' }) @@ -102,7 +102,7 @@ describe('Gore Plugin Tests', () => { macro('gore', { from:anchorPoint, radius:25, - goreNumber:4, + gores:4, extraLength:0, prefix:'gore' })