|
@@ -21,6 +21,7 @@
|
|
|
var _activated = true;
|
|
|
var _$body = $('body');
|
|
|
var _$container = _$body;
|
|
|
+ var _dpi = window.devicePixelRatio;
|
|
|
var _$canvas = $('<canvas id="corpus-map">').appendTo(_$container);
|
|
|
var _canvas = _$canvas[0];
|
|
|
var _ctx = _canvas.getContext('2d');
|
|
@@ -92,10 +93,15 @@
|
|
|
onResizeCanvas();
|
|
|
};
|
|
|
function onResizeCanvas() {
|
|
|
- _canvas.width = window.innerWidth;
|
|
|
- _canvas.height = window.innerHeight;
|
|
|
- for (var i = 0; i < _nodes.length; i++) {
|
|
|
- _nodes[i].onResizeCanvas();
|
|
|
+
|
|
|
+ _canvas.width = window.innerWidth*_dpi;
|
|
|
+ _canvas.height = window.innerHeight*_dpi;
|
|
|
+
|
|
|
+
|
|
|
+ if(_nodes.length){
|
|
|
+ for (var i = 0; i < _nodes.length; i++) {
|
|
|
+ _nodes[i].onResizeCanvas();
|
|
|
+ }
|
|
|
// move _attracter and _repulser to the center again
|
|
|
resizePhysics();
|
|
|
}
|
|
@@ -483,7 +489,7 @@
|
|
|
// _ctx.fillStyle = _ecolors[this.e_color];
|
|
|
// _ctx.fillRect(this.x - this.r,this.y - this.r,this.r*2,this.r*2);
|
|
|
// ou carre contour
|
|
|
- _ctx.lineWidth = '2px';
|
|
|
+ _ctx.lineWidth = 1.5;
|
|
|
_ctx.fillStyle = 'rgb(255,255,255)';
|
|
|
_ctx.fillRect(this.x - this.r,this.y - this.r,this.r*2,this.r*2);
|
|
|
_ctx.strokeStyle = _ecolors[this.e_color];
|