Palette floater canvas size fix

This commit is contained in:
BoykoAlex
2019-11-19 23:01:28 -05:00
parent ef72b025fd
commit 84dfdd04b4

View File

@@ -553,14 +553,13 @@ export class Palette implements OnInit, OnDestroy, OnChanges {
});
// Only node view expected
const view = this.floaterpaper.findViewByModel(floaternode);
let box: dia.BBox = (<dia.ElementView>view).getBBox();
this.viewBeingDragged = this.floaterpaper.findViewByModel(floaternode);
let box: dia.BBox = (<dia.ElementView>this.viewBeingDragged).getBBox();
let size: dia.Size = floaternode.get('size');
parent.css('width', size.width + 10);
parent.css('height', size.height + 10);
parent.css('width', box.width + box.width - size.width);
parent.css('height', box.height + box.height - size.height);
// Account for node real size including ports
floaternode.translate(box.width - size.width, box.height - size.height);
this.viewBeingDragged = this.floaterpaper.findViewByModel(floaternode);
parent.offset({left: event.pageX + 5, top: event.pageY + 5});
} else {
$('#palette-floater').offset({left: event.pageX + 5, top: event.pageY + 5});