# HG changeset patch # User am@osimis.io # Date 1542627937 -3600 # Node ID 8bf717c4e4975c3682565b91a54b831437b1f209 # Parent d638d5721f1c54b96a5dc2e9dceb0b40c781c806 canvas size is now defined by the parent div size diff -r d638d5721f1c -r 8bf717c4e497 Applications/Samples/SimpleViewer/Wasm/simple-viewer.html --- a/Applications/Samples/SimpleViewer/Wasm/simple-viewer.html Thu Nov 15 18:41:50 2018 +0100 +++ b/Applications/Samples/SimpleViewer/Wasm/simple-viewer.html Mon Nov 19 12:45:37 2018 +0100 @@ -18,11 +18,15 @@ -
- - +
+
+ +
+
+ +
-
+
diff -r d638d5721f1c -r 8bf717c4e497 Applications/Samples/Web/index.html --- a/Applications/Samples/Web/index.html Thu Nov 15 18:41:50 2018 +0100 +++ b/Applications/Samples/Web/index.html Mon Nov 19 12:45:37 2018 +0100 @@ -10,7 +10,6 @@ Wasm Samples -
    diff -r d638d5721f1c -r 8bf717c4e497 Applications/Samples/Web/samples-styles.css --- a/Applications/Samples/Web/samples-styles.css Thu Nov 15 18:41:50 2018 +0100 +++ b/Applications/Samples/Web/samples-styles.css Mon Nov 19 12:45:37 2018 +0100 @@ -0,0 +1,16 @@ +html, body { + width: 100%; + height: 100%; + margin: 0px; + border: 0; + overflow: hidden; /* Disable scrollbars */ + display: block; /* No floating content on sides */ + background-color: black; + color: white; + font-family: Arial, Helvetica, sans-serif; +} + +canvas { + left:0px; + top:0px; +} \ No newline at end of file diff -r d638d5721f1c -r 8bf717c4e497 Applications/Samples/Web/simple-viewer-single-file.html --- a/Applications/Samples/Web/simple-viewer-single-file.html Thu Nov 15 18:41:50 2018 +0100 +++ b/Applications/Samples/Web/simple-viewer-single-file.html Mon Nov 19 12:45:37 2018 +0100 @@ -1,16 +1,17 @@ - - - + + + + - - - + + + - Simple Viewer - + Simple Viewer + -
    - - +
    +
    + +
    +
    + +
    -
    +
    line circle diff -r d638d5721f1c -r 8bf717c4e497 Applications/Samples/Web/single-frame-editor.html --- a/Applications/Samples/Web/single-frame-editor.html Thu Nov 15 18:41:50 2018 +0100 +++ b/Applications/Samples/Web/single-frame-editor.html Mon Nov 19 12:45:37 2018 +0100 @@ -13,8 +13,8 @@ -
    - +
    +
    diff -r d638d5721f1c -r 8bf717c4e497 Applications/Samples/Web/single-frame.html --- a/Applications/Samples/Web/single-frame.html Thu Nov 15 18:41:50 2018 +0100 +++ b/Applications/Samples/Web/single-frame.html Mon Nov 19 12:45:37 2018 +0100 @@ -13,8 +13,8 @@ -
    - +
    +
    diff -r d638d5721f1c -r 8bf717c4e497 Platforms/Wasm/wasm-viewport.ts --- a/Platforms/Wasm/wasm-viewport.ts Thu Nov 15 18:41:50 2018 +0100 +++ b/Platforms/Wasm/wasm-viewport.ts Mon Nov 19 12:45:37 2018 +0100 @@ -137,12 +137,9 @@ this.imageData_ = null; } - // width/height can be defined in percent of window width/height through html attributes like data-width-ratio="50" and data-height-ratio="20" - var widthRatio = Number(this.htmlCanvas_.dataset["widthRatio"]) || 100; - var heightRatio = Number(this.htmlCanvas_.dataset["heightRatio"]) || 100; - - this.htmlCanvas_.width = window.innerWidth * (widthRatio / 100); - this.htmlCanvas_.height = window.innerHeight * (heightRatio / 100); + // width/height is defined by the parent width/height + this.htmlCanvas_.width = this.htmlCanvas_.parentElement.offsetWidth; + this.htmlCanvas_.height = this.htmlCanvas_.parentElement.offsetHeight; console.log("resizing WasmViewport: ", this.htmlCanvas_.width, "x", this.htmlCanvas_.height);