From 897ed67ba445048a8481e3be612e079bb0a7568b Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Mon, 21 Aug 2023 17:38:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=AF=E9=80=89=E9=85=8D?= =?UTF-8?q?=E7=BD=AE--=E6=A1=86=E9=80=89=E6=A1=86=E7=9A=84=E9=A2=9C?= =?UTF-8?q?=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlgraphic/plugins/CommonMousePlugin.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/jlgraphic/plugins/CommonMousePlugin.ts b/src/jlgraphic/plugins/CommonMousePlugin.ts index 746475b..70027b5 100644 --- a/src/jlgraphic/plugins/CommonMousePlugin.ts +++ b/src/jlgraphic/plugins/CommonMousePlugin.ts @@ -14,6 +14,10 @@ export interface IMouseToolOptions { * 是否启用框选,默认启用 */ boxSelect?: boolean; + /** + * 框选框的颜色--默认黑色 + */ + boxSelectColor?: string; /** * 是否启用视口拖拽(默认右键),默认启用 */ @@ -32,6 +36,7 @@ class CompleteMouseToolOptions implements IMouseToolOptions { boxSelect: boolean; viewportDrag: boolean; wheelZoom: boolean; + boxSelectColor?: string; selectFilter?: GraphicSelectFilter | undefined; constructor() { this.boxSelect = true; @@ -48,6 +53,7 @@ class CompleteMouseToolOptions implements IMouseToolOptions { if (options.wheelZoom != undefined) { this.wheelZoom = options.wheelZoom; } + this.boxSelectColor = options.boxSelectColor; this.selectFilter = options.selectFilter; } } @@ -287,7 +293,7 @@ export class CommonMouseTool extends AppInteractionPlugin { if (!this.drag) return; // 绘制框选矩形框 this.box.clear(); - this.box.lineStyle({ width: 1, color: 0x000000 }); + this.box.lineStyle({ width: 1, color: this.options.boxSelectColor }); const dsx = end.x - start.x; const dsy = end.y - start.y; let { x, y } = start;