mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-22 23:20:00 +08:00
fix: 修复页面滚动高亮偏移的问题
This commit is contained in:
parent
f500e51933
commit
6a46f98766
@ -61,7 +61,7 @@ export default class StageCore extends EventEmitter {
|
||||
this.renderer = new StageRender({ core: this });
|
||||
this.mask = new StageMask({ core: this });
|
||||
this.dr = new StageDragResize({ core: this, container: this.mask.content });
|
||||
this.highlightLayer = new StageHighlight({ core: this, container: this.mask.content });
|
||||
this.highlightLayer = new StageHighlight({ core: this, container: this.mask.wrapper });
|
||||
|
||||
this.renderer.on('runtime-ready', (runtime: Runtime) => this.emit('runtime-ready', runtime));
|
||||
this.renderer.on('page-el-update', (el: HTMLElement) => this.mask?.observe(el));
|
||||
|
@ -46,6 +46,15 @@ export default class StageHighlight extends EventEmitter {
|
||||
this.moveable?.destroy();
|
||||
this.moveable = new Moveable(this.container, {
|
||||
target: this.target,
|
||||
scrollable: true,
|
||||
origin: true,
|
||||
zoom: 1,
|
||||
bounds: {
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: this.container.clientWidth,
|
||||
bottom: this.container.clientHeight,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -240,6 +240,7 @@ export default class StageMask extends Rule {
|
||||
};
|
||||
|
||||
private mouseWheelHandler = (event: WheelEvent) => {
|
||||
this.emit('clearHighlight');
|
||||
if (!this.page) throw new Error('page 未初始化');
|
||||
|
||||
const { deltaY, deltaX } = event;
|
||||
|
Loading…
x
Reference in New Issue
Block a user