1
0
Fork 0

Merge branch 'develop' into i18n3

This commit is contained in:
joostdecock 2023-06-26 18:50:52 +02:00
commit fe61e85fa9
101 changed files with 3291 additions and 2445 deletions

View file

@ -176,7 +176,7 @@ Part.prototype.shorthand = function () {
get: function (measurements, name) {
if (typeof measurements[name] === 'undefined')
self.context.store.log.warning(
`Tried to access \`measurements.${name}\` but it is \`undefined\``
`${self.name} tried to access \`measurements.${name}\` but it is \`undefined\``
)
return Reflect.get(...arguments)
},

View file

@ -52,6 +52,30 @@ Snippet.prototype.clone = function () {
return clone
}
/**
* Helper method to scale a snippet
*
* @param {number} scale - The scale to set
* @param {bool} overwrite - Whether to overwrite the existing scale or not (default is true)
*
* @return {Snippet} this - The snippet instance
*/
Snippet.prototype.scale = function (scale, overwrite = true) {
return this.attr('data-scale', scale, overwrite)
}
/**
* Helper method to rotate a snippet
*
* @param {number} rotation - The rotation to set
* @param {bool} overwrite - Whether to overwrite the existing rotation or not (default is true)
*
* @return {Snippet} this - The snippet instance
*/
Snippet.prototype.rotate = function (rotation, overwrite = true) {
return this.attr('data-rotate', rotation, overwrite)
}
/**
* Returns a snippet as an object suitable for inclusion in renderprops
*