mirror of
https://github.com/lxsang/antos-frontend.git
synced 2025-02-22 09:52:47 +01:00
fix dot export
This commit is contained in:
parent
a0008663ab
commit
7878364f57
@ -123,17 +123,19 @@ class DotEditor extends this.OS.GUI.BaseApplication
|
||||
|
||||
export: (t) ->
|
||||
me = @
|
||||
me.openDialog "FileDiaLog", (d, n) ->
|
||||
me.openDialog "PromptDialog", (s) ->
|
||||
me._gui.openDialog "FileDiaLog", (d, n) ->
|
||||
fp = "#{d}/#{n}".asFileHandler()
|
||||
scale = Number(s)
|
||||
try
|
||||
switch t
|
||||
when "SVG"
|
||||
fp.cache = Viz me.editor.getValue(), { format: "svg", scale: 1 }
|
||||
fp.cache = Viz me.editor.getValue(), { format: "svg", scale: scale}
|
||||
fp.write "text/plain", (r) ->
|
||||
return me.error __("Cannot export to {0}: {1}", t, r.error) if r.error
|
||||
me.notify __("File exported")
|
||||
when "PNG"
|
||||
content = Viz me.editor.getValue(), { format: "png-image-element", scale: 1}
|
||||
content = Viz me.editor.getValue(), { format: "png-image-element", scale: scale}
|
||||
content.onload = () ->
|
||||
fp.cache = @src
|
||||
fp.write "base64", (r) ->
|
||||
@ -142,6 +144,8 @@ class DotEditor extends this.OS.GUI.BaseApplication
|
||||
catch e
|
||||
me.error __("Cannot export: {0}", e.message)
|
||||
, __("Export as"), { file: me.currfile }
|
||||
, "__(Scale)", { label: "__(Diagram scale)" }
|
||||
|
||||
|
||||
renderSVG: (silent) ->
|
||||
console.log "render svg"
|
||||
|
Loading…
x
Reference in New Issue
Block a user