Commit Graph

12 Commits (a47fe7f9446ce097ff7e6800f04999186b9bec78)

Author SHA1 Message Date
ash 5a6b37f3cc Use /usr/bin/env as shebang everywhere
It's not guaranteed that bash will be available at /bin/bash; it's even
less likely that node will always be installed at /usr/bin/node{,js}.
Always indirecting through /usr/bin/env means that there is only one
such path that needs to be available.
2022-08-17 23:03:21 +01:00
Gordon Williams d07580cc90 Add minified layout library, which should improve layout speed a lot. 2022-06-09 10:41:03 +01:00
Gordon Williams ad038d4c34 updated layout tests 2022-05-04 11:22:23 +01:00
Gordon Williams 90e3915e24 fix test regression 2022-05-04 11:08:36 +01:00
Gordon Williams f41b3c5a88 Update bootloader to include polyfills for g.wrapString, g.imageMetrics, g.stringMetrics - and modify Layout lib to use those functions 2021-10-18 12:01:40 +01:00
Gordon Williams 3f26b8b88e Layout module now allows 'soft' buttons to be cycled through and selected using up/down on Bangle.js 1 2021-10-18 11:32:46 +01:00
Ben Whittaker 202690de40 Layout: Implement text wrapping 2021-10-04 16:06:46 -04:00
Ben Whittaker 3622895f09 Layout: avoid floating point numbers
The previous approach involved calculating the width of each element
independently, and deriving the `x` coordinate of each element by
summing the previous widths. However, if the widths are rounded, summing
them leads to accumulated rounding errors.

This change effectively takes the alternate approach of calculating the
`x` coordinate of each element independently, and then deriving the
widths from the differences between adjacent values of `x`.

As a bonus, this change corrects a couple issues in the
`padding_with_fill` test.
2021-09-28 23:07:00 -04:00
Ben Whittaker 221c3acc94 Layout: make `pad` behave more consistently
Fixes the second test case in #819
2021-09-24 17:43:56 -04:00
Ben Whittaker 807ac743fc Layout: only set fillxy/y if null
Fixes #820
2021-09-23 22:32:06 -04:00
Gordon Williams 16fe84704b add test for accellog 2021-09-23 13:02:24 +01:00
Gordon Williams 0109a8114b Ensure padding works correctly (fix #819), also add Layout test harness basics 2021-09-23 12:47:12 +01:00