dist/modules/extras/label-types/BasicLabelType.js
/**
     * Render a label to workspace
     * @param label label to be rendered
     */
Render a label to workspace
@param label label to be rendered
Render a label to workspace @param label label to be rendered
render(label) {
        const path = this.vectorize(label);
        const ratio = 1 / this.workspace.zoom;
        const class_ = this.labeller.getClass(label.class_id);
        const color = new paper_1.Color(class_.color);
        path.style = {
            strokeColor: color,
            fillColor: this.options.hasFill ? new paper_1.Color(color.red, color.green, color.blue, this.labelPrefs.fill.opacity) : null,
            strokeWidth: this.labelPrefs.stroke.width * ratio,
            selectedColor: color
        };
        const selected = this.labeller.selected ? this.labeller.selected.id : -1;
        let tag = null;
        if (this.options.showLabelTag) {
            if (label.id !== selected || !this.options.hideTagOnSelect)
                tag = this.showLabelTag(label, path, ratio);
        }
        if (label.id === selected)
            this.select(label, path, ratio);
        return path;
    }
render ( label ) { const path = this . vectorize ( label ) ; const ratio = 1 / this . workspace . zoom ; const class_ = this . labeller . getClass ( label . class_id ) ; const color = new paper_1 . Color ( class_ . color ) ; path . style = { strokeColor : color , fillColor : this . options . hasFill ? new paper_1 . Color ( color . red , color . green , color . blue , this . labelPrefs . fill . opacity ) : null , strokeWidth : this . labelPrefs . stroke . width * ratio , selectedColor : color } ; const selected = this . labeller . selected ? this . labeller . selected . id : - 1 ; let tag = null ; if ( this . options . showLabelTag ) { if ( label . id !== selected || ! this . options . hideTagOnSelect ) tag = this . showLabelTag ( label , path , ratio ) ; } if ( label . id === selected ) this . select ( label , path , ratio ) ; return path ; }
Render a label to workspace
 @param label label to be rendered
Render a label to workspace @param label label to be rendered
// style path // create the tag // show tag if not selected or if hide on select is unset // render selections