Skip to content

Commit 4060ff3

Browse files
Overwrite the width/height if its computed value is 0px
Rebuild build.js. Update CHANGES.md.
1 parent 1696f13 commit 4060ff3

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGES
22
=======
33

4+
dev
5+
---
6+
7+
Improvements:
8+
- Overwrite the width/height if its computed value is `0px`
9+
410
1.2.0
511
-----
612

docs/build.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/graphics3d.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ function setDefaultContainerStyle(container) {
1919
const style = getComputedStyle(container);
2020

2121
if (!style.display) container.style.display = 'block';
22-
if (!style.width) container.style.width = '65vw';
22+
if (!style.width || style.width === '0px') container.style.width = '65vw';
2323
if (!style.maxWidth) container.style.maxWidth = '400px';
24-
if (!style.height) container.style.height = '65vw';
24+
if (!style.height || style.height === '0px') container.style.height = '65vw';
2525
if (!style.maxHeight) container.style.maxHeight = '400px';
2626
// Avoid overflow when a tick numbers is out of the parent element.
2727
if (!style.paddingTop) container.style.paddingTop = '5px';

0 commit comments

Comments
 (0)