Browse Source

'文本直线图标item修改'

zhangyu 5 years ago
parent
commit
fa99642eaa

+ 0 - 1
saga-web-big/src/items/SIconTextItem.ts

@@ -156,7 +156,6 @@ export class SIconTextItem extends SObjectItem {
       });
       this.update();
       this.textItem.text = "";
-      this.textItem.backgroundColor = SColor.White;
       this.textItem.font.size = 12;
       // 偏移二分之一文本高度
       this.textItem.moveTo(17, -(this.textItem.height * 0.5));

+ 1 - 1
saga-web-big/src/items/SLineItem.ts

@@ -36,7 +36,7 @@ export class SLineItem extends SGraphItem {
     }
 
     /** 是否完成绘制  */
-    private _status: SItemStatus = SItemStatus.Normal;
+    protected _status: SItemStatus = SItemStatus.Normal;
     get status(): SItemStatus {
         return this._status;
     }

+ 11 - 13
saga-web-graph/src/items/STextItem.ts

@@ -59,7 +59,7 @@ export class STextItem extends SObjectItem {
     }
 
     /** 边框色 */
-    private _strokeColor: SColor = SColor.Black;
+    private _strokeColor: SColor = SColor.Transparent;
     get strokeColor(): SColor {
         return this._strokeColor;
     }
@@ -132,23 +132,21 @@ export class STextItem extends SObjectItem {
     protected drawShowText(painter: SPainter): void {
         //绘制矩形轮廓
         if (this.selected) {
-            this.borderStyle = SLineStyle.Dashed;
+            painter.shadow.shadowBlur = 10;
+            painter.shadow.shadowColor = new SColor(`#00000060`);
+            painter.shadow.shadowOffsetX = 5;
+            painter.shadow.shadowOffsetY = 5;
         } else {
-            this.borderStyle = SLineStyle.None;
-        }
-        if (this.borderStyle == SLineStyle.Dashed) {
-            painter.pen.lineDash = [
-                this.lineWidth * 3,
-                this.lineWidth * 7
-            ];
-            painter.pen.lineWidth = this.lineWidth;
-            painter.brush.color = this.backgroundColor;
-            painter.pen.color = this.strokeColor;
-            painter.drawRect(this.boundingRect());
+            painter.shadow.shadowColor = SColor.Transparent;
         }
+        painter.brush.color = this.backgroundColor;
+        painter.pen.lineWidth = this.lineWidth;
+        painter.pen.color = this.strokeColor;
+        painter.drawRect(this.boundingRect());
 
         //绘制文本
         painter.brush.color = new SColor(this.color);
+        painter.shadow.shadowColor = SColor.Transparent;
         painter.font = this.font;
         this._textArr.forEach((text: string, index: number) => {
             painter.drawText(