Browse Source

Update toolbar pos

pull/2524/head
Artur Arseniev 7 years ago
parent
commit
fe4af050fc
  1. 10
      src/commands/view/SelectComponent.js

10
src/commands/view/SelectComponent.js

@ -572,14 +572,14 @@ export default {
if (pos) {
const frameOffset = canvas.getCanvasView().getFrameOffset();
pos.top = this.frameRect(el, 1, pos);
pos.left = this.frameRect(el, 0, pos);
// Scroll with the window if the top edge is reached and the
// element is bigger than the canvas
if (
pos.top <= pos.canvasTop &&
!(pos.elementHeight + pos.targetHeight >= frameOffset.height)
) {
pos.top = pos.elementTop + pos.elementHeight;
const fullHeight = pos.elementHeight + pos.targetHeight;
if (pos.top <= pos.canvasTop && !(fullHeight >= frameOffset.height)) {
pos.top = pos.top + fullHeight;
}
// Check left position of the toolbar

Loading…
Cancel
Save