|
@ -717,12 +717,26 @@ class Label { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
getFormattingValues(ctx, selected, hover, mod) { |
|
|
getFormattingValues(ctx, selected, hover, mod) { |
|
|
|
|
|
var getValue = function(fontOptions, mod, option) { |
|
|
|
|
|
if (mod === "normal") { |
|
|
|
|
|
if (option === 'mod' ) return ""; |
|
|
|
|
|
return fontOptions[option]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (fontOptions[mod][option]) { |
|
|
|
|
|
return fontOptions[mod][option]; |
|
|
|
|
|
} else { |
|
|
|
|
|
// Take from parent font option
|
|
|
|
|
|
return fontOptions[option]; |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
let values = { |
|
|
let values = { |
|
|
color: (mod === "normal") ? this.fontOptions.color : this.fontOptions[mod].color, |
|
|
|
|
|
size: (mod === "normal") ? this.fontOptions.size : this.fontOptions[mod].size, |
|
|
|
|
|
face: (mod === "normal") ? this.fontOptions.face : this.fontOptions[mod].face, |
|
|
|
|
|
mod: (mod === "normal") ? "" : this.fontOptions[mod].mod, |
|
|
|
|
|
vadjust: (mod === "normal") ? this.fontOptions.vadjust : this.fontOptions[mod].vadjust, |
|
|
|
|
|
|
|
|
color : getValue(this.fontOptions, mod, 'color' ), |
|
|
|
|
|
size : getValue(this.fontOptions, mod, 'size' ), |
|
|
|
|
|
face : getValue(this.fontOptions, mod, 'face' ), |
|
|
|
|
|
mod : getValue(this.fontOptions, mod, 'mod' ), |
|
|
|
|
|
vadjust: getValue(this.fontOptions, mod, 'vadjust'), |
|
|
strokeWidth: this.fontOptions.strokeWidth, |
|
|
strokeWidth: this.fontOptions.strokeWidth, |
|
|
strokeColor: this.fontOptions.strokeColor |
|
|
strokeColor: this.fontOptions.strokeColor |
|
|
}; |
|
|
}; |
|
|