Commit graph

21 commits

Author SHA1 Message Date
Marc Durdin
9da4ffa77a fix(web): font size was not consistently set
Fixes #5779.
Fixes #5731 (I believe mitigation is sufficient to close this issue).

A variety of interrelated font and font size display issues resolved:
1. KVK font was not applied early enough for size calculations, which
   meant that we were calculating font scaling per key based on a
   default font when transforming from the KVK data for desktop devices
   (defaultLayout.ts)
2. Font scaling for non-default layers was calculated when elements were
   not visible and had no size information, giving incorrect values. To
   resolve this, font scaling is now calculated when a layer is made
   visible, which had performance impacts; resolved by reducing
   unnecessary `layer.refreshLayout()` calls; see performance point 1
   below (oskView.ts:layerChangeHandler())
3. `getViewportScale()` would return an incorrect scaled value when
   emulating touch devices on a desktop browser (kmwutils.ts)
4. After switching keyboards, the device-specific scaling factor was not
   maintained (oskView.ts:refreshLayout())

Related performance improvements:
1. Multiple calls to `layer.refreshLayout()` in `refreshLayout()` have
   been eliminated, and only the currently visible layer is now
   refreshed. This dramatically reduces the number of calls to
   `getIdealFontSize()` which was the primary concern of #5731.
   (visualKeyboards.ts)
2. Unnecessary use of `innerHTML` replaced with `innerText`
   (oskBaseKey.ts)

Minor Keyman Developer performance improvement:
1. The web debugger no longer recalculates the OSK twice (test.js)
2021-11-15 10:08:18 +11:00
jahorton
31ac1b7c1b chore(web): replaces literals with constants 2021-09-23 09:27:09 +07:00
jahorton
f7dc8e1140 chore(web): Merge branch 'refactor/web/osk-activation-and-visibility' into feat/web/inlined-osk 2021-09-17 15:26:03 +07:00
jahorton
d429c76a52 fix(web): spacebar caption when functional layer differs from display layer 2021-09-14 15:34:27 +07:00
jahorton
6b248075d6 feat(web): partially-functional inlined OSK! 2021-09-01 15:31:01 +07:00
jahorton
2d36215e2e chore(web): Merge branch 'refactor/web/vkbd-touch-events' into refactor/web/vkbd-mouse-events 2021-08-04 10:41:57 +07:00
jahorton
511f056383 chore(web): Merge branch 'refactor/web/vkbd-layout-calcs' into refactor/web/vkbd-layout-key-calc-merger 2021-08-02 09:20:26 +07:00
jahorton
3a9cc742ca refactor(web): OSK mouse input abstraction 2021-07-30 14:50:46 +07:00
Joshua Horton
64ba024a7a
chore(web): Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2021-07-30 09:16:25 +07:00
jahorton
84e2c368cf fix(web): restores key tip, subkey popup positioning 2021-07-27 07:56:54 +07:00
jahorton
3f2897485b refactor(web): drops 'widthpc', 'padpc' 2021-07-26 15:59:25 +07:00
jahorton
02f4c436b6 refactor(web): OSKBaseKey.construct 2021-07-26 15:59:25 +07:00
jahorton
f7349a04b1 refactor(web): partial key style merger 2021-07-26 15:59:24 +07:00
jahorton
71298f7d5a refactor(web): properties - fixed width vs fixed height 2021-07-26 15:21:03 +07:00
jahorton
cc1b812791 fix(web): keyboard documentation 2021-07-26 15:21:03 +07:00
jahorton
e90eb643f5 refactor(web): kmw-5rows class: key -> layer 2021-07-26 15:19:23 +07:00
jahorton
3f682ada64 refactor(web): findKeyElement 2021-07-09 12:32:30 +07:00
jahorton
6480f36d02 refactor(web): adjust_Heights -> refreshLayout 2021-07-09 09:03:12 +07:00
jahorton
0beca3b260 refactor(web): cntd integration of new types 2021-07-09 09:02:37 +07:00
jahorton
66d7648ecf refactor(web): OSKRow 2021-07-09 09:02:36 +07:00
jahorton
0566f435d9 refactor(web): osk key class defs -> separate files 2021-06-16 08:39:53 +07:00