fix(editor): 修复fix布局的组件没有吸附效果问题

This commit is contained in:
roymondchen 2022-04-08 21:05:58 +08:00 committed by jia000
parent 4d7b135e50
commit 959638c2c5

View File

@ -367,6 +367,7 @@ export default class StageDragResize extends EventEmitter {
if (!this.target) return {}; if (!this.target) return {};
const isAbsolute = this.mode === Mode.ABSOLUTE; const isAbsolute = this.mode === Mode.ABSOLUTE;
const isFixed = this.mode === Mode.FIXED;
let { moveableOptions = {} } = this.core.config; let { moveableOptions = {} } = this.core.config;
@ -381,8 +382,8 @@ export default class StageDragResize extends EventEmitter {
dragArea: false, dragArea: false,
draggable: true, draggable: true,
resizable: true, resizable: true,
snappable: isAbsolute, snappable: isAbsolute || isFixed,
snapGap: isAbsolute, snapGap: isAbsolute || isFixed,
snapThreshold: 5, snapThreshold: 5,
snapDigit: 0, snapDigit: 0,
throttleDrag: 0, throttleDrag: 0,