src_js/iconolab-bundle/src/components/editor/ShapeFree.vue
changeset 418 a04c55054afe
parent 408 159042869b47
child 420 0a4779c0e445
--- a/src_js/iconolab-bundle/src/components/editor/ShapeFree.vue	Thu Mar 09 12:39:36 2017 +0100
+++ b/src_js/iconolab-bundle/src/components/editor/ShapeFree.vue	Mon Mar 13 18:48:35 2017 +0100
@@ -1,5 +1,5 @@
 <template>
-    <g filter="url(#shadow)">
+    <g ref="g" filter="url(#shadow)">
         <path ref="path" v-bind:d="path"
             class="path"
             v-bind:stroke-width="handlerRadius / 2"
@@ -29,6 +29,7 @@
             'paper',
             'original-annotation',
             'readonly',
+            'original-path'
         ],
         data() {
             return {
@@ -39,7 +40,11 @@
             }
         },
         mounted() {
-
+            if (this.originalPath) {
+                this.fromSVGPath(this.originalPath, false);
+                var g = new Snap(this.$refs.g);
+                g.click(() => this.$emit('click'));
+            }
         },
         watch: {
             closed: function(closed) {
@@ -195,8 +200,12 @@
 }
 .path {
     stroke: #000;
-    fill: #fff;
-    opacity: 0.6;
+    fill: transparent;
+}
+.path:hover {
+    cursor: pointer;
+    fill: #333;
+    opacity: 0.5;
 }
 .handler--first {
     fill: yellow;