src_js/iconolab-bundle/src/components/editor/Canvas.vue
changeset 437 0aa597a588c1
parent 434 924d95c07149
child 444 d57f95ee9115
--- a/src_js/iconolab-bundle/src/components/editor/Canvas.vue	Wed Mar 15 17:11:48 2017 +0100
+++ b/src_js/iconolab-bundle/src/components/editor/Canvas.vue	Wed Mar 15 17:34:53 2017 +0100
@@ -33,6 +33,7 @@
                     v-bind:original-annotation="annotation"
                     v-bind:original-path="annotation.path"
                     v-bind:readonly="readonly"
+                    v-bind:stroke-width="strokeWidth"
                     v-on:click="onAnnotationClick(annotation)"></shape-free>
 
                 <!-- These are the new fragments -->
@@ -44,6 +45,7 @@
                 <shape-free ref="free"
                     v-show="loaded &amp;&amp; !readonly &amp;&amp; mode == 'free'"
                     v-bind:paper="paper"
+                    v-bind:stroke-width="strokeWidth"
                     :readonly="false"></shape-free>
 
                 <defs>
@@ -147,7 +149,8 @@
                 imgMinSize: 0,
                 imageWidth: 0,
                 imageHeight: 0,
-                readonly: false
+                readonly: false,
+                strokeWidth: 15,
             }
         },
         computed: {
@@ -201,16 +204,16 @@
                     height: bcr.height
                 };
 
+                var handlerSize = 15 * Math.min(viewBox[2], viewBox[3]) / viewport.width;
+
+                this.$refs.rect.handlerSize = handlerSize;
+
                 Object.assign(this, {
                     viewBox: viewBox,
                     viewport: viewport,
+                    strokeWidth: handlerSize / 4,
                 });
 
-                var handlerSize = 15 * Math.min(viewBox[2], viewBox[3]) / viewport.width;
-
-                this.$refs.rect.handlerSize = handlerSize;
-                this.$refs.free.handlerRadius = handlerSize / 2;
-
                 this.paper.attr({"viewBox": this.viewBox});
 
                 if (_.size(this.annotations) > 0) {