Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(PanoViewer): improve cubemap support #131

Merged
merged 17 commits into from
Jan 30, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions dist/PanoViewer/view360.panoviewer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/PanoViewer/view360.panoviewer.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/PanoViewer/view360.panoviewer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/PanoViewer/view360.panoviewer.min.js.map

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions dist/PanoViewer/view360.panoviewer.pkgd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/PanoViewer/view360.panoviewer.pkgd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/PanoViewer/view360.panoviewer.pkgd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/PanoViewer/view360.panoviewer.pkgd.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/SpinViewer/view360.spinviewer.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/SpinViewer/view360.spinviewer.pkgd.js.map

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions dist/view360.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/view360.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/view360.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/view360.min.js.map

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions dist/view360.pkgd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/view360.pkgd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/view360.pkgd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/view360.pkgd.min.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/PanoImageRenderer/WebGLUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,19 @@ export default class WebGLUtils {
* @retuen {Boolean} isStableWebGL
*/
static isStableWebGL() {
let isStableWebgl = true;
const isWebGLAvailable = WebGLUtils.isWebGLAvailable();
const agentInfo = agent();
let isStableWebgl = true;

if (agentInfo.os.name === "android" && parseFloat(agentInfo.os.version) <= 4.3) {
if (!isWebGLAvailable) {
isStableWebgl = false;
} else if (agentInfo.os.name === "android" && parseFloat(agentInfo.os.version) <= 4.3) {
isStableWebgl = false;
} else if (agentInfo.os.name === "android" && parseFloat(agentInfo.os.version) === 4.4) {
if (agentInfo.browser.name !== "chrome") {
isStableWebgl = false;
}
} else if (agentInfo.os.name === "ios" && parseInt(agentInfo.os.version, 10) <= 7) {
isStableWebgl = false;
}

return isStableWebgl;
}

Expand Down
3 changes: 1 addition & 2 deletions src/PanoViewer/PanoViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ export default class PanoViewer extends Component {
* @param {Array} [config.yawRange=[-180, 180]] Range of controllable Yaw values <ko>제어 가능한 Yaw 값의 범위</ko>
* @param {Array} [config.pitchRange=[-90, 90]] Range of controllable Pitch values <ko>제어 가능한 Pitch 값의 범위</ko>
* @param {Array} [config.fovRange=[30, 110]] Range of controllable vertical field of view values <ko>제어 가능한 수직 field of view 값의 범위</ko>
* @param {Function} [config.checkSupport] A function that returns a boolean value that determines whether the component is working. <ko>뷰어가 작동할 지 여부를 결정하는 부울 값을 반환하는 함수입니다.</ko>
*/
constructor(container, options = {}) {
super();

if (options.checkSupport && !options.checkSupport()) {
if (!WebGLUtils.isStableWebGL()) {
setTimeout(() => {
this.trigger(EVENTS.ERROR, {
type: ERROR_TYPE.INVALID_DEVICE,
Expand Down
18 changes: 18 additions & 0 deletions test/unit/PanoViewer/PanoViewer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,24 @@ describe("PanoViewer", function() {
});
});

describe("#setter/getter", function() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did't understand this test describe block. because it doesn't have it block

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I'll remove that.

let target;
let panoViewer;

beforeEach(() => {
target = sandbox();
target.innerHTML = `<div></div>`;
});

afterEach(() => {
if (!panoViewer) {
return;
}
panoViewer.destroy();
panoViewer = null;
});
});

describe("viewChange event", function() {
let target;
let panoViewer;
Expand Down