Browse Source

fixes #1164

tags/v0.3.2.9
Big Bad Waffle 5 years ago
parent
commit
7f6edbcf42
3 changed files with 25 additions and 2 deletions
  1. +1
    -1
      src/client/js/rendering/renderer.js
  2. +23
    -0
      src/client/ui/templates/passives/passives.js
  3. +1
    -1
      src/client/ui/templates/passives/styles.less

+ 1
- 1
src/client/js/rendering/renderer.js View File

@@ -88,7 +88,7 @@ define([
backgroundColor: '0x2d2136'
});

window.onresize = this.onResize.bind(this);
window.addEventListener('resize', this.onResize.bind(this));

$(this.renderer.view)
.appendTo('.canvas-container');


+ 23
- 0
src/client/ui/templates/passives/passives.js View File

@@ -48,6 +48,8 @@ define([

hoverNode: null,

handlerResize: null,

postRender: function () {
input.init(this.el);

@@ -69,6 +71,9 @@ define([
display: 'block'
});

this.handlerResize = this.onResize.bind(this);
window.addEventListener('resize', this.handlerResize);

let zoom = window.devicePixelRatio;

this.canvas = this.find('.canvas')[0];
@@ -107,6 +112,24 @@ define([
}
},

beforeDestroy: function () {
window.removeEventListener('resize', this.handlerResize);
},

onResize: function () {
if (isMobile)
return;
let zoom = window.devicePixelRatio;

this.size.w = this.canvas.width = this.find('.bottom').width() * zoom;
this.size.h = this.canvas.height = this.find('.bottom').height() * zoom;

this.ctx.lineWidth = constants.lineWidth;

this.renderNodes();
},

renderNodes: function () {
if (!this.shown)
return;


+ 1
- 1
src/client/ui/templates/passives/styles.less View File

@@ -44,7 +44,7 @@
}

.canvas{
width: 100vw;
width: calc(100vw - 10px);
}
}



Loading…
Cancel
Save