Skip to content

Commit

Permalink
Merge pull request Kitware#1959 from yarous224/draco_compatibility
Browse files Browse the repository at this point in the history
fix(DracoReader): Compatible with Draco 1.4.0
  • Loading branch information
jourdain authored Jun 22, 2021
2 parents 84a7e35 + ee5e723 commit 00960d0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Sources/IO/Geometry/DracoReader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@ function setWasmBinary(url, binaryName) {
xhr.onload = () => {
if (xhr.status === 200) {
dracoDecoderType.wasmBinary = xhr.response;
decoderModule = window.DracoDecoderModule(dracoDecoderType);
resolve(true);
// Use Promise.resolve to be compatible with versions before Draco 1.4.0
Promise.resolve(window.DracoDecoderModule(dracoDecoderType)).then(
(module) => {
decoderModule = module;
resolve(true);
},
reject
);
} else {
reject(Error(`WASM binary could not be loaded: ${xhr.statusText}`));
}
Expand Down

0 comments on commit 00960d0

Please sign in to comment.