Put all the code within the if statement
This commit is contained in:
parent
0aeb6caadb
commit
b978247785
1 changed files with 12 additions and 10 deletions
|
@ -123,21 +123,23 @@ const Listeners = {
|
|||
})
|
||||
|
||||
$(window).resize(function () {
|
||||
var canvas = Visualize.mGraph.canvas,
|
||||
if (Visualize && Visualize.mGraph){
|
||||
var canvas = Visualize.mGraph.canvas,
|
||||
scaleX = canvas.scaleOffsetX,
|
||||
scaleY = canvas.scaleOffsetY,
|
||||
centrePixX = Visualize.mGraph.canvas.canvases[0].size.width / 2,
|
||||
centrePixY = Visualize.mGraph.canvas.canvases[0].size.height / 2,
|
||||
centreCoords = Util.pixelsToCoords({x:centrePixX ,y:centrePixY});
|
||||
|
||||
if (Visualize && Visualize.mGraph) Visualize.mGraph.canvas.resize($(window).width(), $(window).height())
|
||||
|
||||
canvas.scale(scaleX,scaleY);
|
||||
var newCentrePixX = Visualize.mGraph.canvas.canvases[0].size.width / 2,
|
||||
newCentrePixY = Visualize.mGraph.canvas.canvases[0].size.height / 2,
|
||||
newCentreCoords = Util.pixelsToCoords({x:newCentrePixX ,y:newCentrePixY});
|
||||
|
||||
canvas.translate(newCentreCoords.x - centreCoords.x, newCentreCoords.y - centreCoords.y);
|
||||
|
||||
Visualize.mGraph.canvas.resize($(window).width(), $(window).height())
|
||||
|
||||
canvas.scale(scaleX,scaleY);
|
||||
var newCentrePixX = Visualize.mGraph.canvas.canvases[0].size.width / 2,
|
||||
newCentrePixY = Visualize.mGraph.canvas.canvases[0].size.height / 2,
|
||||
newCentreCoords = Util.pixelsToCoords({x:newCentrePixX ,y:newCentrePixY});
|
||||
|
||||
canvas.translate(newCentreCoords.x - centreCoords.x, newCentreCoords.y - centreCoords.y);
|
||||
}
|
||||
|
||||
if (Active.Map && Realtime.inConversation) Realtime.positionVideos()
|
||||
Mobile.resizeTitle()
|
||||
|
|
Loading…
Reference in a new issue