Skip to content

Commit 0423adf

Browse files
JJJollyjimqu1ck
authored andcommitted
Add touchscreen drag/zoom support (#93)
* 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
1 parent afe7f4f commit 0423adf

File tree

5 files changed

+189
-52
lines changed

5 files changed

+189
-52
lines changed

InteractiveHtmlBom/core/ibom.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ def get_file_content(file_name):
545545
html = get_file_content("ibom.html")
546546
html = html.replace('///CSS///', get_file_content('ibom.css'))
547547
html = html.replace('///SPLITJS///', get_file_content('split.js'))
548+
html = html.replace('///POINTER_EVENTS_POLYFILL///', get_file_content('pep.js'))
548549
html = html.replace('///CONFIG///', config_js)
549550
html = html.replace('///PCBDATA///', pcbdata_js)
550551
html = html.replace('///UTILJS///', get_file_content('util.js'))

InteractiveHtmlBom/web/ibom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,3 +611,7 @@ a {
611611
.dark a {
612612
color: #00b9fd;
613613
}
614+
615+
#frontcanvas, #backcanvas {
616+
touch-action: none;
617+
}

InteractiveHtmlBom/web/ibom.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
///SPLITJS///
1414
///////////////////////////////////////////////
1515

16+
///////////////////////////////////////////////
17+
///POINTER_EVENTS_POLYFILL///
18+
///////////////////////////////////////////////
19+
1620
///////////////////////////////////////////////
1721
///CONFIG///
1822
///////////////////////////////////////////////
@@ -151,15 +155,15 @@
151155
</table>
152156
</div>
153157
<div id="canvasdiv" class="split split-horizontal">
154-
<div id="frontcanvas" class="split" style="overflow: hidden">
158+
<div id="frontcanvas" class="split" touch-action="none" style="overflow: hidden">
155159
<div style="position: relative; width: 100%; height: 100%;">
156160
<canvas id="F_bg" style="position: absolute; left: 0; top: 0; z-index: 0;"></canvas>
157161
<canvas id="F_fab" style="position: absolute; left: 0; top: 0; z-index: 1;"></canvas>
158162
<canvas id="F_slk" style="position: absolute; left: 0; top: 0; z-index: 2;"></canvas>
159163
<canvas id="F_hl" style="position: absolute; left: 0; top: 0; z-index: 3;"></canvas>
160164
</div>
161165
</div>
162-
<div id="backcanvas" class="split" style="overflow: hidden">
166+
<div id="backcanvas" class="split" touch-action="none" style="overflow: hidden">
163167
<div style="position: relative; width: 100%; height: 100%;">
164168
<canvas id="B_bg" style="position: absolute; left: 0; top: 0; z-index: 0;"></canvas>
165169
<canvas id="B_fab" style="position: absolute; left: 0; top: 0; z-index: 1;"></canvas>

InteractiveHtmlBom/web/pep.js

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)