浏览代码

修改图标item

haojianlong 4 年之前
父节点
当前提交
fbdf0f307f
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/lib/items/SImageLegendItem.js
  2. 1 1
      src/lib/items/SImageLegendItem.ts

+ 1 - 1
src/lib/items/SImageLegendItem.js

@@ -53,7 +53,7 @@ export class SImageLegendItem extends SIconTextItem {
         }
         else {
             // 偏移二分之一文本高度
-            this.textItem.moveTo((this.img.width * 0.5) + 2, -(this.font.size * 0.5));
+            this.textItem.moveTo((this.img.width * 0.5), -(this.font.size * 1.25 * 0.5));
         }
         if (data.Properties && data.Properties.color) {
             this.color = new SColor(data.Properties.color);

+ 1 - 1
src/lib/items/SImageLegendItem.ts

@@ -98,7 +98,7 @@ export class SImageLegendItem extends SIconTextItem {
             this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
         } else {
             // 偏移二分之一文本高度
-            this.textItem.moveTo((this.img.width * 0.5) + 2, -(this.font.size * 0.5));
+            this.textItem.moveTo((this.img.width * 0.5), -(this.font.size * 1.25 * 0.5));
         }
         if (data.Properties && data.Properties.color) {
             this.color = new SColor(data.Properties.color);