Skip to content

Commit febb7f8

Browse files
paulmassonmrdoob
authored andcommitted
Add iOS workaround to BoxGeometry (mrdoob#9196)
* Add iOS workaround to BoxGeometry * Update iOS workaround * Update iOS workaround * Update iOS workaround * Update iOS workaround
1 parent 2005d67 commit febb7f8

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

docs/api/extras/geometries/BoxGeometry.html

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,23 @@ <h1>[name]</h1>
1414

1515
<div class="desc">BoxGeometry is the quadrilateral primitive geometry class. It is typically used for creating a cube or irregular quadrilateral of the dimensions provided with the 'width', 'height', and 'depth' constructor arguments.</div>
1616

17-
<iframe src='scenes/geometry-browser.html#BoxGeometry'></iframe>
17+
<iframe id="scene" src="scenes/geometry-browser.html#BoxGeometry"></iframe>
18+
19+
<script>
20+
21+
// iOS iframe auto-resize workaround
22+
23+
if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
24+
25+
var scene = document.getElementById( 'scene' );
26+
27+
scene.style.width = getComputedStyle( scene ).width;
28+
scene.style.height = getComputedStyle( scene ).height;
29+
scene.setAttribute( 'scrolling', 'no' );
30+
31+
}
32+
33+
</script>
1834

1935
<h2>Example</h2>
2036

@@ -26,7 +42,6 @@ <h2>Example</h2>
2642

2743
<h2>Constructor</h2>
2844

29-
3045
<h3>[name]([page:Float width], [page:Float height], [page:Float depth], [page:Integer widthSegments], [page:Integer heightSegments], [page:Integer depthSegments])</h3>
3146
<div>
3247
width — Width of the sides on the X axis.<br />
@@ -37,7 +52,6 @@ <h3>[name]([page:Float width], [page:Float height], [page:Float depth], [page:In
3752
depthSegments — Optional. Number of segmented faces along the depth of the sides. Default is 1.
3853
</div>
3954

40-
4155
<h2>Properties</h2>
4256

4357
<h3>.parameters</h3>

0 commit comments

Comments
 (0)