Skip to content

Commit

Permalink
fix: rendering issue below ios 10
Browse files Browse the repository at this point in the history
  • Loading branch information
WoodNeck committed Dec 31, 2020
1 parent 927e69f commit 25391c6
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 27 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"types": "declaration/index.d.ts",
"scripts": {
"start": "webpack-dev-server --open --host 0.0.0.0",
"build": "rm -rf ./dist && rollup -c && npm run declaration && npm run printsizes",
"build": "rm -rf ./dist && rollup -c && npm run declaration && npm run printsizes",
"watch": "rollup -c -w",
"declaration": "rm -rf declaration && tsc -p tsconfig.declaration.json",
"printsizes": "print-sizes ./dist --exclude=\\.map",
"test": "karma start",
Expand Down
2 changes: 1 addition & 1 deletion src/PanoImageRenderer/PanoImageRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,13 +601,13 @@ class PanoImageRenderer extends Component<{

gl.useProgram(shaderProgram);
(shaderProgram as any).vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
gl.enableVertexAttribArray((shaderProgram as any).vertexPositionAttribute);
(shaderProgram as any).pMatrixUniform = gl.getUniformLocation(shaderProgram, "uPMatrix");
(shaderProgram as any).mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
(shaderProgram as any).samplerUniform = gl.getUniformLocation(shaderProgram, "uSampler");
(shaderProgram as any).textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");
(shaderProgram as any).uEye = gl.getUniformLocation(shaderProgram, "uEye");

gl.enableVertexAttribArray((shaderProgram as any).vertexPositionAttribute);
gl.enableVertexAttribArray((shaderProgram as any).textureCoordAttribute);

// clear buffer
Expand Down
2 changes: 0 additions & 2 deletions src/PanoImageRenderer/WebGLUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ export default class WebGLUtils {
gl.attachShader(program, fragmentShader);
gl.linkProgram(program);

gl.detachShader(program, vertexShader);
gl.detachShader(program, fragmentShader);
gl.deleteShader(vertexShader);
gl.deleteShader(fragmentShader);

Expand Down
2 changes: 1 addition & 1 deletion test/manual/PanoViewer/ContextLost.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ <h3>number of active viewers: <span id="contextCnt">0</span></h3>
</script>
</body>

</html>
</html>
4 changes: 2 additions & 2 deletions test/manual/PanoViewer/Events.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ <h2>Events</h2>
"animationEnd": eventLogger,
"error": eventLogger,
});

function eventLogger(evt) {
console.log(evt);
log && log(evt.eventType);
Expand All @@ -79,4 +79,4 @@ <h2>Events</h2>
</script>
</body>

</html>
</html>
6 changes: 3 additions & 3 deletions test/manual/PanoViewer/FullScreen.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h1 class="ui header">Full Screen</h1>
</div>
</div>
<div id="fullscreen-container"></div>

<!--To use semantic-ui-->
<script src="../lib/jquery-3.3.1.min.js"></script>
<script src="../lib/semantic.min.js"></script>
Expand All @@ -74,7 +74,7 @@ <h1 class="ui header">Full Screen</h1>
<script>
var isFullScreen = false;
var container = document.getElementById("panoviewer-showcase");

var PanoViewer = eg.view360.PanoViewer;
var panoViewer = new PanoViewer(container, {
yaw: 180,
Expand All @@ -93,4 +93,4 @@ <h1 class="ui header">Full Screen</h1>
});
</script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion test/manual/PanoViewer/PanoVideo.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ <h3>Available on Chrome Browser</h3>
</script>
</body>

</html>
</html>
10 changes: 5 additions & 5 deletions test/manual/PanoViewer/PanoViewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ <h1 class="pageTitle">PanoViewer Manual Test</h1>
"folders": {}
}
}
}
}
};

var gridView = new GridView(document.querySelector(".grid-chart"), 0, 0);
Expand Down Expand Up @@ -286,7 +286,7 @@ <h1 class="pageTitle">PanoViewer Manual Test</h1>
gui.remember(object);

var params = {
loadFile : function() {
loadFile : function() {
document.querySelector('#file').click();
},
aspectRatio: 1,
Expand Down Expand Up @@ -427,8 +427,8 @@ <h1 class="pageTitle">PanoViewer Manual Test</h1>
panoViewer.updateViewportDimensions();
});

gui.add(params, 'aspectRatio',
{
gui.add(params, 'aspectRatio',
{
"1:1": 1, "16:9": 16/9, "9:16": 9/16,
"2:1": 2, "1:2": 1/2, "21:9": 21/9, "9:21": 9/21
}
Expand Down Expand Up @@ -485,4 +485,4 @@ <h1 class="pageTitle">PanoViewer Manual Test</h1>
window.panoViewer = panoViewer;
})();
</script>
</html>
</html>
2 changes: 1 addition & 1 deletion test/manual/PanoViewer/TouchDirection.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ <h1 class="pageTitle">TouchDirection Manual Test</h1>

})();
</script>
</html>
</html>
9 changes: 5 additions & 4 deletions test/manual/PanoViewer/Visible.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ <h2>Visible Activation</h2>
viewerEl.classList.add("inactive");
instance.destroy();
photo360ViewerMap[key] = null;
}
}
});

// 보이게 된 엘리먼트 처리
Expand All @@ -145,7 +145,7 @@ <h2>Visible Activation</h2>
var instance = photo360ViewerMap[key];

// 인스턴스가 없으면 초기화 후 키 생성
if (!instance) {
if (!instance) {
delete viewerEl["__photo360__"];
key = (new Date()).getTime() + idx;

Expand All @@ -164,7 +164,8 @@ <h2>Visible Activation</h2>
}, 10);
}).on("suspend", function(evt) {
viewerEl.classList.add("inactive");
}).on("error", function() {
}).on("error", function(e) {
console.error(e);
alert("이 브라우저는 webgl 을 지원하지 않습니다. 따라서 PanoViewer 가 동작할 수 없습니다.");
});
viewerEl.classList.add("loading");
Expand Down Expand Up @@ -219,4 +220,4 @@ <h2>Visible Activation</h2>

</script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion test/manual/SpinViewer/SpinViewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ <h3>options</h3>
return options.scale * 2000 / window.innerWidth;
}
</script>
</html>
</html>
4 changes: 2 additions & 2 deletions test/manual/SpinViewer/SpriteImage.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ <h3>Play Options</h3>
"horizontal": {interval: 100, playCount: 10},
"grid":{interval: 16}
}

var verticalSpriteImage = new eg.view360.SpriteImage(document.getElementById("vertical-sprites"), {
imageUrl: "../img/SpinViewer/foodwindow.jpg",
rowCount: 48,
Expand Down Expand Up @@ -140,4 +140,4 @@ <h3>Play Options</h3>
sprites[type].stop();
}
</script>
</html>
</html>
6 changes: 3 additions & 3 deletions test/manual/YawPitchControl.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ <h1 class="pageTitle">YawPitchControl Manual Test</h1>
"folders": {}
}
}
}
}
};
var gridView = new GridView(document.querySelector(".grid-chart"), 0, 0);
var threePanoView = new ThreePanoView(document.querySelector( '.pano-viewer' ), object.image, 0, 0, object.pitchRangeSize < 65 ? object.pitchRangeSize : 65, 1);
Expand Down Expand Up @@ -268,7 +268,7 @@ <h1 class="pageTitle">YawPitchControl Manual Test</h1>
const yawRange = yawpitch.options.yawRange;
const pitchRange = yawpitch.options.pitchRange;
const fovRange = yawpitch.options.fovRange;

threePanoView.render(yaw, pitch, fov);
gridView.render(yaw, pitch, yawRange, pitchRange);

Expand All @@ -286,4 +286,4 @@ <h1 class="pageTitle">YawPitchControl Manual Test</h1>
document.getElementById("fov_range_max_value").innerHTML = fovRange[1].toFixed(0);
}
</script>
</html>
</html>

0 comments on commit 25391c6

Please sign in to comment.