1
0
Fork 0

fix(plugin-dimension): Support hiding start/end markers

This commit is contained in:
Joost De Cock 2022-01-18 08:29:43 +01:00
parent 22c9d39955
commit c25323b10c

View file

@ -108,13 +108,14 @@ export default {
// path
pd: function (so) {
const id = so.id || this.getId(prefix)
if (typeof so.d === 'undefined') so.d = 10 * this.context.settings.scale
const dimension = so.path
.offset(so.d)
.attr('class', 'mark')
.attr('marker-start', 'url(#dimensionFrom)')
.attr('marker-end', 'url(#dimensionTo)')
.attr('data-text', so.text || this.units(so.path.length()))
.attr('data-text-class', 'fill-mark center')
if (!so.noStartMarker) dimension.attributes.set('marker-start', 'url(#dimensionFrom)')
if (!so.noEndMarker) dimension.attributes.set('marker-end', 'url(#dimensionTo)')
this.paths[id] = dimension
drawLeader(this, so.path.start(), dimension.start(), id + '_ls')
drawLeader(this, so.path.end(), dimension.end(), id + '_le')