Skip to content

Commit

Permalink
fix #2541, scale circles in pitch views (#2544)
Browse files Browse the repository at this point in the history
  • Loading branch information
ansis authored and lucaswoj committed May 9, 2016
1 parent de0b22c commit b0afb6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion js/render/draw_circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ function drawCircles(painter, source, layer, coords) {

var program = painter.useProgram('circle', bucket.getProgramMacros('circle', layer));

gl.uniform2fv(program.u_extrude_scale, painter.transform.pixelsToGLUnits);
gl.uniform2f(program.u_extrude_scale,
painter.transform.pixelsToGLUnits[0] * painter.transform.altitude,
painter.transform.pixelsToGLUnits[1] * painter.transform.altitude);
gl.uniform1f(program.u_blur, layer.paint['circle-blur']);
gl.uniform1f(program.u_devicepixelratio, browser.devicePixelRatio);
gl.uniform1f(program.u_opacity, layer.paint['circle-opacity']);
Expand Down
4 changes: 1 addition & 3 deletions shaders/circle.vertex.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ void main(void) {
// in extrusion data
gl_Position = u_matrix * vec4(floor(a_pos * 0.5), 0, 1);

// gl_Position is divided by gl_Position.w after this shader runs.
// Multiply the extrude by it so that it isn't affected by it.
gl_Position.xy += extrude * gl_Position.w;
gl_Position.xy += extrude;

#ifdef ATTRIBUTE_A_COLOR
v_color = a_color / 255.0;
Expand Down

0 comments on commit b0afb6d

Please sign in to comment.