Skip to content

Commit

Permalink
more rebasing, get tests to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Molly Lloyd committed Nov 11, 2016
1 parent 0474103 commit 5c1a195
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
7 changes: 6 additions & 1 deletion js/data/bucket/line_bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ const lineInterface = {
{name: 'a_data', components: 4, type: 'Uint8'}
]),
paintAttributes: [
{property: 'line-color', type: 'Uint8'}
{property: 'line-color', type: 'Uint8'},
{property: 'line-blur', type: 'Uint8'},
{property: 'line-opacity', type: 'Uint8'},
{property: 'line-width', type: 'Uint8'},
{property: 'line-gap-width', type: 'Uint8'},
{property: 'line-offset', type: 'Uint8'},
],
elementArrayType: createElementArrayType()
};
Expand Down
11 changes: 1 addition & 10 deletions js/render/draw_line.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,8 @@ function drawLineTile(program, painter, tile, buffers, layer, coord, layerData,
gl.uniform1f(program.u_fade, image.t);
}

// the distance over which the line edge fades out.
// Retina devices need a smaller distance to avoid aliasing.
const antialiasing = 1 / browser.devicePixelRatio;

gl.uniform1f(program.u_linewidth, layer.paint['line-width'] / 2);
gl.uniform1f(program.u_gapwidth, layer.paint['line-gap-width'] / 2);
gl.uniform1f(program.u_antialiasing, antialiasing / 2);
gl.uniform1f(program.u_blur, layer.paint['line-blur'] + antialiasing);
gl.uniform1f(program.u_opacity, layer.paint['line-opacity']);

gl.uniformMatrix2fv(program.u_antialiasingmatrix, false, painter.transform.lineAntialiasingMatrix);
gl.uniform1f(program.u_offset, -layer.paint['line-offset']);
gl.uniform1f(program.u_extra, painter.transform.lineStretch);
}

Expand Down

0 comments on commit 5c1a195

Please sign in to comment.