From f416530d382ee48678d26fdcd58a6ee9426be865 Mon Sep 17 00:00:00 2001 From: oceanzhu Date: Thu, 20 Oct 2022 20:40:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(stage):=20=E4=BF=AE=E5=A4=8D=E8=BE=85?= =?UTF-8?q?=E5=8A=A9=E7=BA=BF=E6=98=BE=E9=9A=90=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix #444 --- packages/stage/src/Rule.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/stage/src/Rule.ts b/packages/stage/src/Rule.ts index b30617e1..dfd54ae8 100644 --- a/packages/stage/src/Rule.ts +++ b/packages/stage/src/Rule.ts @@ -12,6 +12,7 @@ export default class Rule extends EventEmitter { private container: HTMLDivElement; private containerResizeObserver: ResizeObserver; + private isShowGuides = true; constructor(container: HTMLDivElement) { super(); @@ -32,16 +33,18 @@ export default class Rule extends EventEmitter { } /** - * 是否显示标尺 - * @param show 是否显示 + * 是否显示辅助线 + * @param isShowGuides 是否显示 */ - public showGuides(show = true) { + public showGuides(isShowGuides = true) { + this.isShowGuides = isShowGuides; + this.hGuides.setState({ - showGuides: show, + showGuides: isShowGuides, }); this.vGuides.setState({ - showGuides: show, + showGuides: isShowGuides, }); } @@ -135,6 +138,7 @@ export default class Rule extends EventEmitter { lineColor: '#000', textColor: '#000', style: this.getGuidesStyle(type), + showGuides: this.isShowGuides, }); private hGuidesChangeGuidesHandler = (e: GuidesEvents['changeGuides']) => {