       true
       visible)))
 
-(defn render-submorphs [self]
-  (dom/div #js {:className "originNode"}
+(defn render-submorphs [self & [offset]]
+  (when offset (prn offset))
+  (dom/div #js {:className "originNode" 
+                :style (if offset 
+                         (dict->js {"position" "absolute",
+                                    "top" (str (/ (:y offset) 2) "px !important"),
+                                    "left" (str (/ (:x offset) 2) "px !important"),
+                                    "marginTop" "-2px",
+                                    "margineft" "-2px"})
+                         {})}
     (apply dom/div nil
       (om/build-all morph (get self :submorphs) {:state {:owner (om/ref-cursor self)}}))))
 

    ;; we apply some customizations to the style, to make the shape elliptical
    (let [ellipse-style (assoc style 
                               "borderRadius" (str (style "width") "px /" (style "height") "px"))]
      (dom/div #js {:style (dict->js ellipse-style)} (render-submorphs app)))))

(defmethod shape :default [app owner]
  (let [style (extract-shape-css app)]

    (om/update! ->owner :submorphs (conj submorphs morph))))

(defn remove-morph [->owner morph-id]
  (let [submorphs (get @->owner :submorphs)
        new-submorphs (into [] (filter #(not= (% :id) morph-id) submorphs))]
    (prn (map #(% :id) new-submorphs))
    (om/update! ->owner :submorphs new-submorphs)))

(defn set-rotation [->morph rad origin]
  (om/update! ->morph :morph (-> (:morph @->morph) (assoc :Rotation rad) (assoc :PivotPoint origin))))

(defn set-position [->morph pos]
  (om/update! ->morph [:morph :Position] pos))
