diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-03-20 10:33:59 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-03-20 10:33:59 -0700 |
commit | 60af6a0493a84665edf98db81e132d61d8d0273c (patch) | |
tree | 9dff8509367b86ff8bbf3ac47db7db2d03dd38dc | |
parent | fb190b5680c995ee9fdaa0e7fbd5fc9e1b67afa9 (diff) | |
parent | 1b8d4a444bf0493e253c99b5d6e2c5b63370cc56 (diff) |
Merge pull request #983 from vvuk/sdl-backbuffer-size
Remove border from canvas to get right values from getBoundingClientRect
-rw-r--r-- | src/shell.html | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/shell.html b/src/shell.html index 8743d403..f7eb9e1f 100644 --- a/src/shell.html +++ b/src/shell.html @@ -6,9 +6,11 @@ <title>Emscripten-Generated Code</title> <style> .emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; } - canvas.emscripten { border: 1px solid black; } textarea.emscripten { font-family: monospace; width: 80%; } div.emscripten { text-align: center; } + div.emscripten_border { border: 1px solid black; } + /* the canvas *must not* have any border or padding, or mouse coords will be wrong */ + canvas.emscripten { border: 0px none; } </style> </head> <body> @@ -17,7 +19,9 @@ <div class="emscripten"> <progress value="0" max="100" id="progress" hidden=1></progress> </div> - <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas> + <div class="emscripten_border"> + <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas> + </div> <hr/> <div class="emscripten"> <input type="checkbox" id="resize">Resize canvas |