Kaynağa Gözat

修改图标canvas绘制

haojianlong 4 yıl önce
ebeveyn
işleme
2d6e93ebed
2 değiştirilmiş dosya ile 6 ekleme ve 6 silme
  1. 3 3
      src/lib/GraphView.ts
  2. 3 3
      src/views/legendLibrary/addForm.vue

+ 3 - 3
src/lib/GraphView.ts

@@ -86,13 +86,13 @@ export class GraphView extends SCanvasView {
         canvas.pen.color = new SColor(this.strokecolor);
         canvas.brush.color = new SColor(this.bgcolor);
         if (this.type == 0) {
-            canvas.drawLine(80, 57, 120, 57);
+            canvas.drawLine(0, 14, 28, 14);
         } else if (this.type == 1) {
-            canvas.drawRect(50, 28, 100, 57);
+            canvas.drawRect(0, 0, 28, 28);
         } else if (this.type == 2) {
             if (this.img) {
                 console.log(this.img)
-                canvas.drawImage(this.img, 86, 43, 28, 28)
+                canvas.drawImage(this.img, 0, 0, 28, 28)
             }
         }
     }

+ 3 - 3
src/views/legendLibrary/addForm.vue

@@ -41,7 +41,7 @@
             </div>
             <div v-show='ruleForm.Type=="Zone" || ruleForm.Type=="Image" || ruleForm.Type =="Line"'>
                 <div style='color:#646C73'>展示预览</div>
-                <div class='input-right' ref='graph'>
+                <div class='input-right' ref='graph' style="width:200px;height:114px;">
                     <canvas id='canvas' :width='canvasWidth' :height='canvasHeight'></canvas>
                 </div>
             </div>
@@ -209,8 +209,8 @@ export default {
             borderLineOptionObject: {
                 src: ''
             },
-            canvasWidth: 200,
-            canvasHeight: 114,
+            canvasWidth: 28,
+            canvasHeight: 28,
             view: null,
             scene: null,
             typeVisualization: [],