We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I tried to convert Canvas to SVG, but failed to convert circles. Circles do not appear in the new SVG.
Here is the API I wrote to implement the transformation:
`import {Context} from 'svgcanvas' handle_saveSvg() { let width = this.canvas.canvas.width let height = this.canvas.canvas.height console.log(width,height,"rect") // let C2S = window.C2S let ctx = new Context(width + 500, height + 500) console.log(ctx, "ctx") for (let pen of this.canvas.store.data.pens) { console.log(pen, "pen") if (pen.type) { let line = pen line.from = {} line.to = {} } this.canvas.renderPenRaw(ctx, pen) } console.log(ctx, "ctx1")
let mySerializedSVG = ctx.getSerializedSvg() console.log(mySerializedSVG, "svg") mySerializedSVG = mySerializedSVG.replace( "<defs/>", `<defs>
` ) mySerializedSVG = mySerializedSVG.replace(/--le5le--/g, '&#x')
const urlObject = window.URL || window const export_blob = new Blob([mySerializedSVG]) const url = urlObject.createObjectURL(export_blob) const a = document.createElement('a') let name = sessionStorage.getItem("areaName") a.setAttribute('download', name + '.svg') a.setAttribute('href', url) const evt = document.createEvent('MouseEvents') evt.initEvent('click', true, true) a.dispatchEvent(evt) }`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I tried to convert Canvas to SVG, but failed to convert circles. Circles do not appear in the new SVG.
Here is the API I wrote to implement the transformation:
`import {Context} from 'svgcanvas'
handle_saveSvg() {
let width = this.canvas.canvas.width
let height = this.canvas.canvas.height
console.log(width,height,"rect")
// let C2S = window.C2S
let ctx = new Context(width + 500, height + 500)
console.log(ctx, "ctx")
for (let pen of this.canvas.store.data.pens) {
console.log(pen, "pen")
if (pen.type) {
let line = pen
line.from = {}
line.to = {}
}
this.canvas.renderPenRaw(ctx, pen)
}
console.log(ctx, "ctx1")
`
)
mySerializedSVG = mySerializedSVG.replace(/--le5le--/g, '&#x')
The text was updated successfully, but these errors were encountered: