Fix scaling of the benchmark

This commit is contained in:
Patrick Walton 2017-09-13 21:03:10 -07:00
parent adf960bafe
commit 299bcd685e
1 changed files with 5 additions and 1 deletions

View File

@ -203,7 +203,11 @@ class BenchmarkTestView extends PathfinderDemoView {
protected get worldTransform() {
const transform = glmatrix.mat4.create();
const translation = this.camera.translation;
glmatrix.mat4.fromTranslation(transform, [translation[0], translation[1], 0]);
glmatrix.mat4.translate(transform, transform, [-1.0, -1.0, 0.0]);
glmatrix.mat4.scale(transform,
transform,
[2.0 / this.canvas.width, 2.0 / this.canvas.height, 1.0]);
glmatrix.mat4.translate(transform, transform, [translation[0], translation[1], 0]);
glmatrix.mat4.scale(transform, transform, [this.camera.scale, this.camera.scale, 1.0]);
const pixelsPerUnit = this.pixelsPerUnit;