TGUI API improvements port

This commit is contained in:
Casey
2022-05-29 13:43:55 -04:00
committed by CHOMPStation2
parent 52e04e5232
commit a08c985862
36 changed files with 674 additions and 272 deletions
+7 -2
View File
@@ -217,8 +217,13 @@
$wrap.width($wrap.width() + 2); //Dumb hack to fix a bizarre sizing bug
var docWidth = $wrap.outerWidth(),
docHeight = $wrap.outerHeight();
var pixelRatio = 1;
if (window.devicePixelRatio) {
pixelRatio = window.devicePixelRatio;
}
var docWidth = Math.floor($wrap.outerWidth() * pixelRatio),
docHeight = Math.floor($wrap.outerHeight() * pixelRatio);
if (posY + docHeight > map.size.y) { //Is the bottom edge below the window? Snap it up if so
posY = (posY - docHeight) - realIconSize - tooltip.padding;