Feedback canvas size

This commit is contained in:
BoykoAlex
2019-11-07 13:43:07 -05:00
parent 7edcde8a96
commit 9ed2365c9e
2 changed files with 5 additions and 4 deletions

View File

@@ -3,8 +3,6 @@
#palette-floater {
/* TODO size relative to paper that goes on it? */
opacity: 0.75;
width:170px;
height:60px;
background-color: transparent;
/*
background-color: #6db33f;

View File

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