fix(plugin-dimension): Support hiding start/end markers
This commit is contained in:
parent
22c9d39955
commit
c25323b10c
1 changed files with 3 additions and 2 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue