1
0
Fork 0

Working version

This commit is contained in:
Wouter van Wageningen 2023-04-20 05:44:39 +00:00
parent 895baf48d5
commit 3e91e23ed5
3 changed files with 1 additions and 10 deletions

View file

@ -88,9 +88,6 @@ Defs.prototype.set = function (name, value) {
* @return {Defs} this - The Defs instance
*/
Defs.prototype.setIfUnset = function (name, value) {
// console.log({defsSetIfUnset:{name:name,value:value}})
if (typeof this.list[name] === 'undefined') this.list[name] = [value]
// console.log({list:JSON.parse(JSON.stringify(this.list))})
// console.log({defs:this.render()})
return this
}

View file

@ -46,8 +46,6 @@ export function Svg(pattern) {
* @return {string} svg - The rendered SVG output
*/
Svg.prototype.render = function () {
// console.log('render')
this.idPrefix = this.pattern?.settings?.[0]?.idPrefix || 'fs-'
this.__runHooks('preRender')
if (!this.pattern.settings[0].embed) {
@ -216,10 +214,8 @@ Svg.prototype.__renderCircle = function (point) {
* @return {string} svg - The SVG markup for the defs block
*/
Svg.prototype.__renderDefs = function () {
console.log('__renderDefs')
let svg = '<defs>'
this.__indent()
// console.log({defs:this.defs.render()})
svg += this.__nl() + this.defs.render()
this.__outdent()
svg += this.__nl() + '</defs>' + this.__nl()
@ -234,7 +230,6 @@ Svg.prototype.__renderDefs = function () {
* @return {string} svg - The SVG markup for the head section
*/
Svg.prototype.__renderHead = function () {
// console.log('__renderHead')
let svg = this.__renderStyle()
svg += this.__renderDefs()
svg += this.__openGroup(this.idPrefix + 'container')
@ -296,7 +291,6 @@ Svg.prototype.__renderPart = function (part) {
`${this.idPrefix}stack-${this.activeStack}-part-${part.name}`,
part.attributes
)
svg += this.__openGroup(`${this.idPrefix}stack-${this.activeStack}-part-${part.name}`, part.defs)
for (let key in part.paths) {
let path = part.paths[key]
if (!path.hidden) svg += this.__renderPath(path)