1
0
Fork 0

tada: First commit

This commit is contained in:
Joost De Cock 2018-07-22 18:54:58 +02:00
parent 3d82690400
commit 6efda92f63
11 changed files with 6455 additions and 3 deletions

View file

@ -0,0 +1,28 @@
import style from './lib/style';
const VERSION = require('../package.json').version;
module.exports = {
hooks: {
preRenderSvg: function(next) {
// Without this, our custom attribute won't be valid
this.attributes.add("xmlns:freesewing-plugins", "http://freesewing.org/namespaces/freesewing-plugins");
this.attributes.add("freesewing-plugins:macro-title", VERSION);
this.style += style;
next();
}
}
, macros: {
title: function(next, so) {
let points = this.points;
so.at.attr('data-text', so.nr)
.attr('data-text-class', 'title-nr');
points.titleName = so.at.shift(-90, 20)
.attr('data-text', title)
.attr('data-text-class', 'title-name');
points.titlePattern = so.at.shift(-90, 40)
.attr('data-text', pattern)
.attr('data-text-class', 'title-pattern');
next();
}
}
}