1
0
Fork 0

feat: Do not set plugin configuration object on pattern.use()

Plugins can pass a configuration object (or any
sort of data) when loaded with `pattern.use()`.

We use to set that parameter to `false` when loading, but
now we leave it `undefined`. This makes is easy for plugins
to use a default parameter for the configuration/data passed
to it.
This commit is contained in:
Joost De Cock 2020-04-18 11:36:02 +02:00
parent e134e940e7
commit ff82e2568b

View file

@ -321,7 +321,7 @@ Pattern.prototype.on = function(hook, method, data) {
this.hooks[hook].push({ method, data })
}
Pattern.prototype.use = function(plugin, data = false) {
Pattern.prototype.use = function (plugin, data) {
this.debug({
type: 'success',
label: '🔌 Plugin loaded',
@ -416,8 +416,9 @@ Pattern.prototype.pack = function() {
this.parts[partId].attributes.add('transform', transform)
}
if (transforms.rotate) {
let transform = `rotate(${transforms.rotate}, ${center.x - anchor.x}, ${center.y -
anchor.y})`
let transform = `rotate(${transforms.rotate}, ${center.x - anchor.x}, ${
center.y - anchor.y
})`
this.parts[partId].attributes.add('transform', transform)
}
}