Skip to content

Commit

Permalink
Add touchscreen drag/zoom support (#93)
Browse files Browse the repository at this point in the history
* Add touchscreen pan/zoom support

* Add polyfill for Pointer Events API

Hopefully this commit can be reverted at some point in the future

* Use minified pointer events polyfill

* Code style fixes for touchscreen support

* Add two-finger tap gesture to reset zoom

* Touch support: more style fixes
  • Loading branch information
JJJollyjim authored and qu1ck committed Apr 14, 2019
1 parent afe7f4f commit 0423adf
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 52 deletions.
1 change: 1 addition & 0 deletions InteractiveHtmlBom/core/ibom.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ def get_file_content(file_name):
html = get_file_content("ibom.html")
html = html.replace('///CSS///', get_file_content('ibom.css'))
html = html.replace('///SPLITJS///', get_file_content('split.js'))
html = html.replace('///POINTER_EVENTS_POLYFILL///', get_file_content('pep.js'))
html = html.replace('///CONFIG///', config_js)
html = html.replace('///PCBDATA///', pcbdata_js)
html = html.replace('///UTILJS///', get_file_content('util.js'))
Expand Down
4 changes: 4 additions & 0 deletions InteractiveHtmlBom/web/ibom.css
Original file line number Diff line number Diff line change
Expand Up @@ -611,3 +611,7 @@ a {
.dark a {
color: #00b9fd;
}

#frontcanvas, #backcanvas {
touch-action: none;
}
8 changes: 6 additions & 2 deletions InteractiveHtmlBom/web/ibom.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
///SPLITJS///
///////////////////////////////////////////////

///////////////////////////////////////////////
///POINTER_EVENTS_POLYFILL///
///////////////////////////////////////////////

///////////////////////////////////////////////
///CONFIG///
///////////////////////////////////////////////
Expand Down Expand Up @@ -151,15 +155,15 @@
</table>
</div>
<div id="canvasdiv" class="split split-horizontal">
<div id="frontcanvas" class="split" style="overflow: hidden">
<div id="frontcanvas" class="split" touch-action="none" style="overflow: hidden">
<div style="position: relative; width: 100%; height: 100%;">
<canvas id="F_bg" style="position: absolute; left: 0; top: 0; z-index: 0;"></canvas>
<canvas id="F_fab" style="position: absolute; left: 0; top: 0; z-index: 1;"></canvas>
<canvas id="F_slk" style="position: absolute; left: 0; top: 0; z-index: 2;"></canvas>
<canvas id="F_hl" style="position: absolute; left: 0; top: 0; z-index: 3;"></canvas>
</div>
</div>
<div id="backcanvas" class="split" style="overflow: hidden">
<div id="backcanvas" class="split" touch-action="none" style="overflow: hidden">
<div style="position: relative; width: 100%; height: 100%;">
<canvas id="B_bg" style="position: absolute; left: 0; top: 0; z-index: 0;"></canvas>
<canvas id="B_fab" style="position: absolute; left: 0; top: 0; z-index: 1;"></canvas>
Expand Down
43 changes: 43 additions & 0 deletions InteractiveHtmlBom/web/pep.js

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

Loading

0 comments on commit 0423adf

Please sign in to comment.