From 530c01faa511081d04a715ee78c4dfe211da8210 Mon Sep 17 00:00:00 2001 From: walker Date: Fri, 1 Sep 2023 16:59:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A1=86=E9=80=89=E7=BA=BF?= =?UTF-8?q?=E8=89=B2=E8=87=AA=E9=80=82=E5=BA=94=E7=AE=97=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlgraphic/plugins/CommonMousePlugin.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/jlgraphic/plugins/CommonMousePlugin.ts b/src/jlgraphic/plugins/CommonMousePlugin.ts index 20eec59..3aec9e8 100644 --- a/src/jlgraphic/plugins/CommonMousePlugin.ts +++ b/src/jlgraphic/plugins/CommonMousePlugin.ts @@ -104,8 +104,21 @@ export class CommonMouseTool extends AppInteractionPlugin { private updateBoxLineColor(cp: ICanvasProperties) { // 根据画布背景调整线色 const color = new Color(cp.backgroundColor); - const cn = color.toNumber() ^ 0xffffff; - this._boxLineColor.setValue(cn); + const r = 1 - color.red; + const g = 1 - color.green; + const b = 1 - color.blue; + // const cn = 0xffffff - color.toNumber(); + this._boxLineColor.setValue([r, g, b]); + console.log( + '框选线色', + color.red, + color.green, + color.blue, + this._boxLineColor.red, + this._boxLineColor.green, + this._boxLineColor.blue, + this._boxLineColor + ); } bind(): void { @@ -305,7 +318,7 @@ export class CommonMouseTool extends AppInteractionPlugin { if (!this.drag) return; // 绘制框选矩形框 this.box.clear(); - this.box.lineStyle({ width: 1, color: this._boxLineColor }); + this.box.lineStyle({ width: 2, color: this._boxLineColor }); const dsx = end.x - start.x; const dsy = end.y - start.y; let { x, y } = start;