     return [fieldData, catalogRecord]
     
   doExportSvg: ->
-    svgContext = new C2S(canvas.width, canvas.height)
-    drawEverything svgContext
+    sz = 1024
+    svgContext = new C2S sz, sz#(canvas.width, canvas.height)
+    drawEverything sz, sz, svgContext
     showExportDialog svgContext.getSerializedSvg()
     
 

dirty = true
redraw = -> dirty = true

drawEverything = (context) ->
  return false unless application.observer.canDraw()
  context.fillStyle = "white"  
  #context.clearRect 0, 0, canvas.width, canvas.height
  context.fillRect 0, 0, canvas.width, canvas.height
  context.save()
  s = Math.min( canvas.width, canvas.height ) / 2 #
  context.scale s, s
  context.translate 1, 1
  context.fillStyle = "black"

redrawLoop = ->
  if dirty
    if not fpsLimiting or ((t=Date.now()) - lastTime > dtMax)
      if drawEverything canvas.width, canvas.height, context
        tDraw = Date.now() - t
        #adaptively update FPS
        dtMax = dtMax*0.9 + tDraw*2*0.1
