Commit Graph

8 Commits (42572fb1feeaacf871c162d85418283368dba176)

Author SHA1 Message Date
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