Skip to content

Commit

Permalink
Fix warnings when rendering video
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Wojciechowski committed Nov 3, 2016
1 parent c895387 commit 4bf31de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/render/draw_raster.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ function drawRasterTile(painter, sourceCache, layer, coord) {
const tile = sourceCache.getTile(coord);
const posMatrix = painter.transform.calculatePosMatrix(coord, sourceCache.getSource().maxzoom);

if (!tile.texture) return;

const program = painter.useProgram('raster');
gl.uniformMatrix4fv(program.u_matrix, false, posMatrix);

Expand All @@ -56,7 +58,7 @@ function drawRasterTile(painter, sourceCache, layer, coord) {

gl.activeTexture(gl.TEXTURE1);

if (parentTile) {
if (parentTile && parentTile.texture) {
gl.bindTexture(gl.TEXTURE_2D, parentTile.texture);
parentScaleBy = Math.pow(2, parentTile.coord.z - tile.coord.z);
parentTL = [tile.coord.x * parentScaleBy % 1, tile.coord.y * parentScaleBy % 1];
Expand Down

0 comments on commit 4bf31de

Please sign in to comment.