소스 검색

big:fix:空间事件处理;draw:feat:绘制文本增加外圈描边功能

haojianlong 4 년 전
부모
커밋
f85a1261d4

+ 4 - 0
persagy-web-big/src/items/floor/SSpaceItem.ts

@@ -171,6 +171,7 @@ export class SSpaceItem extends SGraphAreaGroupItem {
      * @return 是否处理事件
      */
     onMouseDown(event: SMouseEvent): boolean {
+        super.onMouseDown(event);
         this.$emit("onMouseDown", event);
         return true;
     }
@@ -182,6 +183,7 @@ export class SSpaceItem extends SGraphAreaGroupItem {
      * @return 是否处理事件
      */
     onMouseUp(event: SMouseEvent): boolean {
+        super.onMouseUp(event);
         this.$emit("onMouseUp", event);
         return true;
     }
@@ -193,6 +195,7 @@ export class SSpaceItem extends SGraphAreaGroupItem {
      * @return 是否处理事件
      */
     onMouseEnter(event: SMouseEvent): boolean {
+        super.onMouseEnter(event);
         this.$emit("onMouseEnter", event);
         return false;
     }
@@ -204,6 +207,7 @@ export class SSpaceItem extends SGraphAreaGroupItem {
      * @return 是否处理事件
      */
     onMouseLeave(event: SMouseEvent): boolean {
+        super.onMouseLeave(event);
         this.$emit("onMouseLeave", event);
         return false;
     }

+ 2 - 0
persagy-web-draw/src/engines/SCanvasPaintEngine.ts

@@ -231,8 +231,10 @@ export class SCanvasPaintEngine extends SPaintEngine {
         this.init((): void => {
             this.setFont();
             if (maxWidth == undefined) {
+                this._canvas.strokeText(text, x, y);
                 this._canvas.fillText(text, x, y);
             } else {
+                this._canvas.strokeText(text, x, y, maxWidth);
                 this._canvas.fillText(text, x, y, maxWidth);
             }
         });

+ 5 - 4
persagy-web-graph/src/SGraphSelectContainer.ts

@@ -713,8 +713,9 @@ export class SGraphSelectContainer extends SGraphItem {
             // 计算边界 8 个点
             this.calExtreme();
             if (
-                this.count > 1 ||
-                (this.count == 1 && this.itemList[0].showSelect)
+                this.showSelect &&
+                (this.count > 1 ||
+                    (this.count == 1 && this.itemList[0].showSelect))
             ) {
                 this.visible = true;
             }
@@ -1008,8 +1009,8 @@ export class SGraphSelectContainer extends SGraphItem {
         this.sceneDis = painter.toPx(this.dis);
         // 多选时 或者 只选择一个并且是需要显示选择器时 绘制
         if (
-            this.count > 1 ||
-            (this.count == 1 && this.itemList[0].showSelect)
+            this.showSelect &&
+            (this.count > 1 || (this.count == 1 && this.itemList[0].showSelect))
         ) {
             painter.pen.lineWidth = painter.toPx(1);
             painter.pen.color = SColor.White;