Bläddra i källkod

Fix stretched WebGL viewport when video with is not a multiple of 16; close #254

phoboslab 7 år sedan
förälder
incheckning
3cadc27b0c
2 ändrade filer med 5 tillägg och 3 borttagningar
  1. 2 2
      jsmpeg.min.js
  2. 3 1
      src/webgl.js

Filskillnaden har hållits tillbaka eftersom den är för stor
+ 2 - 2
jsmpeg.min.js


+ 3 - 1
src/webgl.js Visa fil

83
 	this.canvas.height = this.height;
83
 	this.canvas.height = this.height;
84
 
84
 
85
 	this.gl.useProgram(this.program);
85
 	this.gl.useProgram(this.program);
86
-	this.gl.viewport(0, 0, this.width, this.height);
86
+
87
+	var codedWidth = ((this.width + 15) >> 4) << 4;
88
+	this.gl.viewport(0, 0, codedWidth, this.height);
87
 };
89
 };
88
 
90
 
89
 WebGLRenderer.prototype.createTexture = function(index, name) {
91
 WebGLRenderer.prototype.createTexture = function(index, name) {