提交 d505e4d1 编写于 作者: M Mr.doob

Examples: Workaround for Safari/iOS8 bug.

上级 51f3c18e
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>three.js - examples</title>
<meta charset="utf-8">
<style>
@font-face {
......@@ -67,7 +67,6 @@
#viewer {
position: absolute;
left: 310px;
width: -webkit-calc(100% - 310px); /* Safari */
width: calc(100% - 310px);
height: 100%;
border: 0px;
......@@ -355,6 +354,17 @@
var list = document.getElementById( 'list' );
var viewer = document.getElementById( 'viewer' );
if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
viewer.addEventListener( 'load', function ( event ) {
viewer.contentWindow.innerWidth -= 10;
viewer.contentWindow.innerHeight -= 2;
} );
}
var container = document.createElement( 'div' );
list.appendChild( container );
......
......@@ -137,9 +137,6 @@
function onWindowResize() {
windowHalfX = window.innerWidth / 2;
windowHalfY = window.innerHeight / 2;
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册