   getTransitionFunc: -> @transitionFunc
 
   getMargin: -> if @observer.isDrawingHomePtr then @margin else 0
-  
+  setDrawingHomePtr: (isDrawing)->
+    @observer.isDrawingHomePtr = isDrawing
+    redraw()
+    if localStorage?
+      localStorage.setItem "observer.isDrawingHomePtr", if isDrawing then "1" else "0"
+      console.log "store #{isDrawing}"
+      
   #Convert canvas X,Y coordinates to relative X,Y in (0..1) range
   canvas2relative: (x,y) ->
     s = Math.min(canvas.width, canvas.height) - 2*@getMargin()

      @transitionFunc = @transitionFunc.changeGrid @getGroup().n, @getGroup().m
    
    @observer?.shutdown()
    @observer = new @ObserverClass @tessellation, @appendRewrite, minVisibleSize
    @observer.isDrawingHomePtr = E('flag-origin-mark').checked
    @observer.onFinish = -> redraw()
    @navigator?.clear()
    doClearMemory()

  doSetFixedSize true
  
E('flag-origin-mark').addEventListener 'change', (e)->
  application.setDrawingHomePtr E('flag-origin-mark').checked
  
E('btn-mode-edit').addEventListener 'click', (e) -> doSetPanMode false
E('btn-mode-pan').addEventListener 'click', (e) -> doSetPanMode true
