Browse Source

'图标选中加阴影'

zhangyu 5 years ago
parent
commit
3140ac511e
1 changed files with 15 additions and 1 deletions
  1. 15 1
      saga-web-big/src/items/SIconTextItem.ts

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

@@ -312,10 +312,24 @@ export class SIconTextItem extends SObjectItem {
             painter.pen.color = SColor.Transparent;
             painter.brush.color = this.activeColor;
             if (this.selected) {
+                painter.shadow.shadowBlur = 10;
+                painter.shadow.shadowColor = this.activeColor;
+                painter.shadow.shadowOffsetX = 5;
+                painter.shadow.shadowOffsetY = 5;
                 painter.drawCircle(this.img.x, this.img.y, (this.sWidth / 2.0 + 3) * 1.25);
             } else {
                 painter.drawCircle(this.img.x, this.img.y, this.sWidth / 2.0 + 3);
             }
-        }   
+        } else {
+            if (this.selected) {
+                painter.pen.color = SColor.Transparent;
+                painter.brush.color = SColor.Transparent;
+                painter.shadow.shadowBlur = 10;
+                painter.shadow.shadowColor = new SColor(`#00000033`);
+                painter.shadow.shadowOffsetX = 5;
+                painter.shadow.shadowOffsetY = 5;
+                painter.drawCircle(this.img.x, this.img.y, this.sWidth / 2.0);
+            }
+        }
     } // Function onDraw()
 }