parent
88eb0cb442
commit
7676b9f244
|
@ -76,16 +76,19 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
|
|||
|
||||
function getPosition(element) {
|
||||
|
||||
var Y_OFFSET = 20;
|
||||
var Y_OFFSET = 5;
|
||||
|
||||
var pad = contextPad.getPad(element);
|
||||
var rect = pad.html.getBoundingClientRect();
|
||||
var diagramContainer = canvas.getContainer(),
|
||||
pad = contextPad.getPad(element).html;
|
||||
|
||||
var zoom = 1 / canvas.zoom();
|
||||
var diagramRect = diagramContainer.getBoundingClientRect(),
|
||||
padRect = pad.getBoundingClientRect();
|
||||
|
||||
var top = padRect.top - diagramRect.top;
|
||||
|
||||
var pos = {
|
||||
x: rect.left,
|
||||
y: (rect.top - rect.height * zoom / 2) + rect.height + Y_OFFSET
|
||||
x: padRect.left,
|
||||
y: top + padRect.height + Y_OFFSET
|
||||
};
|
||||
|
||||
return pos;
|
||||
|
|
Loading…
Reference in New Issue