Browse Source

Make the position of guides relative to its active items

pull/1918/head
Artur Arseniev 8 years ago
parent
commit
ab1c9daee8
  1. 6
      src/commands/view/ComponentDrag.js

6
src/commands/view/ComponentDrag.js

@ -315,7 +315,7 @@ module.exports = {
const { onEnd } = opts; const { onEnd } = opts;
onEnd && onEnd(); onEnd && onEnd();
editor.stopCommand(id); editor.stopCommand(id);
this.hideGuidesInfo(); // this.hideGuidesInfo();
}, },
hideGuidesInfo() { hideGuidesInfo() {
@ -368,7 +368,7 @@ module.exports = {
const isEdge1 = isY ? left < rectOrigin.left : top < rectOrigin.top; const isEdge1 = isY ? left < rectOrigin.left : top < rectOrigin.top;
const statEdge1 = isY ? left : top; const statEdge1 = isY ? left : top;
const statEdge2 = isY ? left + width : top + height; const statEdge2 = isY ? left + width : top + height;
const pos2 = `${isY ? top : rectOrigin.left}px`; const pos2 = `${isY ? item.y : item.x}px`;
const size = isEdge1 ? origEdge1 - statEdge2 : statEdge1 - origEdge2; const size = isEdge1 ? origEdge1 - statEdge2 : statEdge1 - origEdge2;
siz = size; siz = size;
guideInfoStyle.display = ''; guideInfoStyle.display = '';
@ -378,8 +378,6 @@ module.exports = {
}px`; }px`;
guideInfoStyle[isY ? 'width' : 'height'] = `${size}px`; guideInfoStyle[isY ? 'width' : 'height'] = `${size}px`;
} }
console.log('axis', axis, 'guide', res, 'size', siz);
// elGuideInfo.innerHTML = length // elGuideInfo.innerHTML = length
}); });
}, },

Loading…
Cancel
Save