From e1a4d5311e68329b9e382654dfe86b3ee86907a2 Mon Sep 17 00:00:00 2001 From: abe- Date: Sat, 17 Jun 2017 16:56:52 +0200 Subject: [PATCH 1/2] parcelas --- docs/graficos/parcelas.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/graficos/parcelas.js b/docs/graficos/parcelas.js index 108093f..6a12b9a 100644 --- a/docs/graficos/parcelas.js +++ b/docs/graficos/parcelas.js @@ -25,7 +25,7 @@ function preload() { function setup() { pg = createGraphics(800, 519); var as = 519. / 800.; - var w = windowWidth*.95; + var w = windowWidth; var h = windowWidth*as; createCanvas(w,h); @@ -37,6 +37,15 @@ function setup() { function draw() { + + // Resize: + var w = min(800,width*.85); + var h = w*519./800.; + var zoom = w*800.; + var mx = map(mouseX-width/2+w/2,0,w,0,800); + var my = map(mouseY-height/2+h/2,0,h,0,519); + + pg.background("#cad2d3"); // capas for (var n = 0; n < ids.length; n++) { @@ -47,7 +56,7 @@ function draw() { } // Parcelas segun PGC - var mc = cmap.get(mouseX,mouseY); + var mc = cmap.get(mx,my); for (var n = 0; n < colores.length; n++) { if (compara(mc,color(colores[n]))) { pg.tint(255,100); @@ -95,8 +104,6 @@ function draw() { pg.text("Datos reales (verde) frente a datos según Plan de Colonización (blanco)", 620, 445, 150, 80); background("#cad2d3"); imageMode(CENTER); - var w = min(800,width*.85); - var h = w*519./800.; image(pg,width/2, height/2,w,h); } From 204b97b02349d38c68d3688857fd52cae54f9490 Mon Sep 17 00:00:00 2001 From: abe- Date: Sat, 17 Jun 2017 17:06:06 +0200 Subject: [PATCH 2/2] parcelas --- docs/_layouts/title.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/_layouts/title.html b/docs/_layouts/title.html index a2a93f3..182acef 100644 --- a/docs/_layouts/title.html +++ b/docs/_layouts/title.html @@ -38,9 +38,6 @@ {{ content }} -