Skip to content

Commit

Permalink
bar: support for debug bar at top of screen [Closes #286]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 22, 2018
1 parent 32aba27 commit 118fea5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Tracy/assets/Bar/bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
panel.toFloat();
setPosition(panel.elem, {
right: getPosition(panel.elem).right + Math.round(Math.random() * 100) + 20,
bottom: getPosition(panel.elem).bottom + Math.round(Math.random() * 100) + 20
bottom: getPosition(panel.elem).bottom + (Math.round(Math.random() * 100) + 20) * (_this.isAtTop() ? -1 : 1)
});
}
}
Expand All @@ -281,7 +281,9 @@
var pos = getPosition(panel.elem);
setPosition(panel.elem, {
right: pos.right - getOffset(link).left + pos.width - getPosition(link).width - 4 + getOffset(panel.elem).left,
bottom: pos.bottom - getOffset(elem).top + pos.height + 4 + getOffset(panel.elem).top
bottom: _this.isAtTop()
? getPosition(elem).bottom - pos.height - 4
: pos.bottom - getOffset(elem).top + pos.height + 4 + getOffset(panel.elem).top
});
}
});
Expand Down Expand Up @@ -322,6 +324,11 @@
}
};

Bar.prototype.isAtTop = function() {
var pos = getPosition(this.elem);
return pos.top < 100 && pos.bottom > pos.top;
};


var Debug = Tracy.Debug = {};

Expand Down

0 comments on commit 118fea5

Please sign in to comment.