Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
Merge branch 'develop' of github.com:Vizzuality/gfw-climate into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrián Pérez committed Dec 1, 2015
2 parents 2f53c1b + 921b3ed commit 80e2b00
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
36 changes: 11 additions & 25 deletions app/assets/javascripts/abstract/layer/CanvasLayerClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,31 +83,17 @@ define([
},

_drawCanvasImage: function(canvasData) {
var canvas = canvasData.canvas;
var image = canvasData.image;
var x = canvasData.x;
var y = canvasData.y;
var z = canvasData.z;

var ctx = canvas.getContext('2d');
var zsteps = this._getZoomSteps(z);

if (zsteps < 0) {
ctx.drawImage(image, 0, 0);
} else {
ctx.imageSmoothingEnabled = false;
ctx.mozImageSmoothingEnabled = false;
ctx.webkitImageSmoothingEnabled = false;

var srcX = 256 / Math.pow(2, zsteps) * (x % Math.pow(2, zsteps));
var srcY = 256 / Math.pow(2, zsteps) * (y % Math.pow(2, zsteps));
var srcW = 256 / Math.pow(2, zsteps);
var srcH = 256 / Math.pow(2, zsteps);

ctx.clearRect(0, 0, 256, 256);
ctx.drawImage(image, srcX, srcY, srcW, srcH, 0, 0, 256, 256);
}

var canvas = canvasData.canvas,
ctx = canvas.getContext('2d'),
image = canvasData.image;

var x = canvasData.x,
y = canvasData.y,
z = canvasData.z;

ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.drawImage(image, 0, 0);

var I = ctx.getImageData(0, 0, canvas.width, canvas.height);
this.filterCanvasImgdata(I.data, canvas.width, canvas.height, z);
ctx.putImageData(I, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion app/views/home/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
| Find facts, maps and figures for your story about forests and climate change here, now.

.link-container
a(href="/compare-countries" class="btn medium white") Learn more
a(href="https://www.youtube.com/watch?v=P_-0NRTHZyM" class="btn medium white" target="_blank") Watch the video
.col.-c5
.slide-background

Expand Down

0 comments on commit 80e2b00

Please sign in to comment.