Commit 89d4b085 authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

automatic resize on window resize

parent f90f7d1d
......@@ -25,8 +25,8 @@
data () {
return {
shapes: {
'rectangle': `M ${this.cx} ${this.cy} m ${-0.5 * this.size} ${-0.5 * this.size} h ${this.size} v ${this.size} h ${-this.size} Z`,
'diamond': `M ${this.cx} ${this.cy} m 0 ${-0.5 * this.size} l ${0.5 * this.size} ${0.5 * this.size} l ${-0.5 * this.size} ${0.5 * this.size} l ${-0.5 * this.size} ${-0.5 * this.size} Z`,
'rectangle': `M ${this.cx} ${this.cy} m ${-0.5 * this.size} ${-0.5 * this.size} h ${this.size} v ${this.size} h ${-this.size} Z`,
'triangle': `M ${this.cx} ${this.cy} m 0 ${-0.5 * this.size} l ${0.5 * this.size} ${this.size} h ${-this.size} Z`
}
}
......
......@@ -473,11 +473,11 @@
}
},
mounted () {
window.addEventListener('resize', this.handleResize)
this.handleResize()
},
beforeDestroy () {
const svg = this.$el.querySelector(`.fjs-vm-root-${this._uid} .fjs-vis-container svg`)
svg.removeEventListener('resize', this.handleResize)
window.removeEventListener('resize', this.handleResize)
},
components: {
DataBox,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment