Skip to content

Commit 150f222

Browse files
committed
Update scenes.tpl
Write zoom info into console for debug
1 parent 2750b4b commit 150f222

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

templates/scenes/scenes.tpl

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,16 +652,26 @@ $(".draggable" ).draggable({ cursor: "move", snap: true , snapTolerance: 5, grid
652652
if(window.innerWidth > 0 && window.innerWidth < zoomw) zoomw = window.innerWidth;
653653
654654
let maxElementX = 0;
655+
let maxElementXTitle = '';
656+
655657
let maxElementY = 0;
658+
let maxElementYTitle = '';
656659
657660
658661
$('.scene_element, .element_state, .scene_wallpaper').each(function() {
659662
let x = $( this ).get(0).getBoundingClientRect().right+20;
660663
let y = $( this ).get(0).getBoundingClientRect().bottom+20;
661-
if (x>maxElementX) maxElementX=x;
662-
if (y>maxElementY) maxElementY=y;
664+
if (x>maxElementX) {
665+
maxElementX = x;
666+
maxElementXTitle = this.id;
667+
}
668+
if (y>maxElementY) {
669+
maxElementY = y;
670+
maxElementYTitle = this.id;
671+
}
663672
});
664673
674+
665675
zoomw = Math.round(zoomw/maxElementX*100);
666676
let zoomh = $(window).height();
667677
if(window.innerHeight > 0 && window.innerHeight < zoomh) zoomh = window.innerHeight;
@@ -681,6 +691,9 @@ $(".draggable" ).draggable({ cursor: "move", snap: true , snapTolerance: 5, grid
681691
}
682692
}
683693
if (newZoom!='') {
694+
console.log('Max element X: ' + maxElementX + ' (' + maxElementXTitle + ')');
695+
console.log('Max element Y: ' + maxElementY + ' (' + maxElementYTitle + ')');
696+
console.log('Zoom: '+newZoom);
684697
document.body.style.zoom = newZoom;
685698
}
686699

0 commit comments

Comments
 (0)