Browse Source

Update partial usage in ComponentDrag

pull/5649/head
Artur Arseniev 3 years ago
parent
commit
369d5d2f2c
  1. 6
      src/commands/view/ComponentDrag.ts
  2. 2
      src/commands/view/SelectComponent.ts

6
src/commands/view/ComponentDrag.ts

@ -282,7 +282,7 @@ export default {
setPosition({ x, y, end, position, width, height }: any) {
const { target, isTran, em } = this;
const unit = 'px';
const en = !end ? 1 : ''; // this will trigger the final change
const __p = !end; // Indicate if partial change
const left = `${x}${unit}`;
const top = `${y}${unit}`;
let styleUp = {};
@ -291,11 +291,11 @@ export default {
let transform = target.getStyle()['transform'] || '';
transform = this.setTranslate(transform, 'x', left);
transform = this.setTranslate(transform, 'y', top);
styleUp = { transform, en };
styleUp = { transform, __p };
target.addStyle(styleUp, { avoidStore: !end });
} else {
const adds: any = { position, width, height };
const style: any = { left, top, en };
const style: any = { left, top, __p };
keys(adds).forEach(add => {
const prop = adds[add];
if (prop) style[add] = prop;

2
src/commands/view/SelectComponent.ts

@ -463,7 +463,7 @@ export default {
{
...style,
// value for the partial update
__p: !store ? 1 : '',
__p: !store,
},
{ avoidStore: !store }
);

Loading…
Cancel
Save