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:
parent
e134e940e7
commit
ff82e2568b
1 changed files with 30 additions and 29 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue