Skip to content

Commit

Permalink
use the newest project API
Browse files Browse the repository at this point in the history
  • Loading branch information
Xintong Xia committed Mar 29, 2019
1 parent ae6fa0b commit 398805a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions modules/core/src/shaderlib/project/project.glsl.js
Expand Up @@ -180,6 +180,9 @@ float project_size_to_pixel(float meters) {
float project_pixel_size(float pixels) {
return pixels;
}
vec2 project_pixel_size(vec2 pixels) {
return pixels;
}
// Deprecated, remove in v8
float project_scale(float meters) {
Expand Down
4 changes: 2 additions & 2 deletions modules/layers/src/icon-layer/icon-layer-vertex.glsl.js
Expand Up @@ -74,8 +74,8 @@ void main(void) {
gl_Position.xy += project_pixel_size_to_clipspace(pixelOffset);
} else {
vec3 offset = vec3(pixelOffset.xy, 0.0);
gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset);
vec3 offset_common = vec3(project_pixel_size(pixelOffset.xy), 0.0);
gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common);
}
vTextureCoords = mix(
Expand Down
Expand Up @@ -81,8 +81,8 @@ void main(void) {
gl_Position.xy += project_pixel_size_to_clipspace(pixelOffset);
} else {
vec3 offset = vec3(pixelOffset.xy, 0.0);
gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset);
vec3 offset_common = vec3(project_pixel_size(pixelOffset.xy), 0.0);
gl_Position = project_position_to_clipspace(instancePositions, instancePositions64xyLow, offset_common);
}
vTextureCoords = mix(
Expand Down
2 changes: 1 addition & 1 deletion test/render/index.js
Expand Up @@ -27,7 +27,7 @@ test('Render Test', t => {
t.timeoutAfter(TEST_CASES.length * 2000);

new SnapshotTestRunner({width: WIDTH, height: HEIGHT})
.add(TEST_CASES.filter(c => c.name === 'icon-lnglat-facing-up'))
.add(TEST_CASES)
.run({
onTestStart: testCase => t.comment(testCase.name),
onTestPass: (testCase, result) => t.pass(`match: ${result.matchPercentage}`),
Expand Down

0 comments on commit 398805a

Please sign in to comment.