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