Olivier Goffart
d2186593c0
Pass the ItemRc to each draw_function
...
So that it can be used as a key to the cache
2022-05-31 10:48:24 +02:00
Olivier Goffart
80830bbece
MCU: Refactor the renderer in a LineRenderer
...
The LineRenderer is going to be a public type which can be used
by the MCU board support to draw.
Right now, it is used by the old code
2022-05-23 16:40:34 +02:00
Simon Hausmann
cf47d3919c
Replace femtovg patch with new release
2022-05-23 09:32:25 +02:00
Simon Hausmann
08fb9a9336
Fix instructions on how to build the mcu printer demo for the simulator
...
With the simulator this still requires a regular main() entry point.
For some reason a feature test for i-slint-backend-mcu/simulator doesn't work,
but it works with the local feature.
2022-05-16 08:29:33 +02:00
Simon Hausmann
77445e9dc5
text handling: simplify text_size signature
...
We can calculate the line height in the common code, that doesn't need to be done in the backends.
2022-05-16 08:21:14 +02:00
Simon Hausmann
38abeaec41
text handling: clean up font traits
...
Separate the text shaping functionality from font metrics by having a
FontMetrics trait next to the TextShaper. AbstractFont is the combining
super trait. This allows eliminating the font height member from
TextParagraphLayout and improving the overall naming of fields and
types.
Finally, this prepares the API for composability of TextShaper for font
fallback handling.
2022-05-16 08:21:14 +02:00
Simon Hausmann
3ce142344a
text handling: cleanup
...
Rename "byte_offset" in the Glyph structure to "text_byte_offset" to make
it clearer that this refers to the original text. Also added docs.
2022-05-16 08:21:14 +02:00
Simon Hausmann
93b5eda82e
text handling: simplify glyph data structure handling
...
Replace the abstract glyph trait with a glyph struct. That way the text
layout code can operate properly on a struct with fields, instead of on
functions on a trait (some of which returning a mutable reference). The
input is a glyph with offset, advance, etc. - everything needed for the
layout and the output is a position along with the platform specific
glyph data.
2022-05-15 12:03:29 +02:00
Simon Hausmann
99ea6db9d4
text handling: simplify shaper <> glyph relation
...
Use the Glyph trait also for the byte offset handling, to avoid the use of
tuples.
2022-05-15 12:03:29 +02:00
Simon Hausmann
5f52f18df4
mcu text handling: Add support for letter spacing
...
This is implemented generically by adjusting the advances on the shape buffer, so that we can
use the same in the future in the GL backend.
2022-05-15 12:03:29 +02:00
Simon Hausmann
a7fb45365d
text handling: remove unused advance getter on TextShaper
...
This is available via GlyphMetrics now.
2022-05-15 11:50:54 +02:00
Simon Hausmann
08e27fef4a
text handling: move function from TextShaper to glyph trait
...
This will avoid the need to keep a reference to the TextShaper
around.
2022-05-15 11:50:14 +02:00
Simon Hausmann
b6e7db0221
Minor cleanup in the MCU text handling
...
Replace the use of Option for the associated glyph type with a
struct that can later implement a trait.
2022-05-15 11:50:00 +02:00
ogoffart
3709ded44d
Bump version number to 0.2.5
2022-05-09 16:16:00 +00:00
ogoffart
c160ec2aef
Bump version number to 0.2.4
2022-05-09 13:49:25 +00:00
ogoffart
6395cdfc09
Bump version number to 0.2.3
2022-05-04 12:32:58 +00:00
Olivier Goffart
1104ab73a0
Fix compilation with integer coordinate
2022-04-28 18:58:11 +02:00
Olivier Goffart
5a9c70307a
MCU: properly round the image source rect
...
to avoid artifacts with different (frational) clipping
2022-04-28 17:45:47 +02:00
Olivier Goffart
ad1936d2d2
Remove new_scene_rectangle indirection
2022-04-27 09:23:10 +02:00
Olivier Goffart
fc65809b9d
stm32h735: cleanup after review
2022-04-27 09:00:52 +02:00
Olivier Goffart
c658792c1e
stm32h735g: cleanup
2022-04-27 09:00:52 +02:00
Olivier Goffart
846ae7cd43
stm32h735g: Instructions in readme
2022-04-27 09:00:52 +02:00
Olivier Goffart
5c507ab86c
stm32h735g: Touch support
2022-04-27 09:00:52 +02:00
Olivier Goffart
199dc1fb18
upgrade stm32h7xx-hal
2022-04-27 09:00:52 +02:00
Olivier Goffart
e41c15aef9
stm32h735g: Add support for double frame buffer and timing
2022-04-27 09:00:52 +02:00
Olivier Goffart
a81d8b7ba4
stm32h735g: The screen actually show the UI now
2022-04-27 09:00:52 +02:00
Olivier Goffart
4755f57fb2
stm32h735g: The screen now show something
2022-04-27 09:00:52 +02:00
Olivier Goffart
0e0526912d
WIP: attempt to get the display working on stm32h735g
...
(doesn't work, the screen is plain white)
2022-04-27 09:00:52 +02:00
Olivier Goffart
df95ee79ba
WIP: setup OCTOSPI2 ram
2022-04-27 09:00:52 +02:00
Olivier Goffart
cc98d53b28
WIP: more work on stm32h735g
2022-04-27 09:00:52 +02:00
Olivier Goffart
703cffd444
WIP: STM32H735G support
2022-04-27 09:00:52 +02:00
Olivier Goffart
f5baef4262
MCU: fix drawing of clipped rounded rectangle with border
2022-04-12 16:15:33 +02:00
Olivier Goffart
cc1aad8ce9
MCU: fix panic in the renderer
...
Sometimes, BorderRectangle clips can get negative if the intersection
of two rectangle leads to a rectangle that is smaller than the previous
rectangle, but because of floating point error while computing the max
position, the resulting clip may still be negative.
Add a small value to compensate that error
2022-04-12 16:12:41 +02:00
Olivier Goffart
8327ab3e52
MCU renderer: query the geometry of items we do not support
...
So that we can register dependencies and refresh when it moves, even
if we don't draw anything for them
2022-04-12 13:02:58 +02:00
Olivier Goffart
1b91158b46
corelib: allow to use i32 for coordinate instead of f32
2022-04-11 17:46:50 +02:00
Simon Hausmann
afb59cba29
mcu: fix popups not visibly closing
...
When closing a popup, notify the platform window, so that the mcu
backend can remember that region and start the dirty region with it.
Also, free all the rendering cache items of deleted items, to avoid accidental re-use
when re-opening a popup.
2022-04-08 19:32:33 +02:00
Simon Hausmann
db54da2064
mcu: Don't panic when opening popups
...
Implement popups as inline components. The dirty region handling however
is still missing when closing a popup.
2022-04-08 16:46:12 +02:00
Simon Hausmann
70f3f50359
mcu: Add support for automatic font size detection
...
Continue to support specififying logical font sizes in the compile step
via SLINT_FONT_SIZES, but additionally look for Text/TextInput/Window elements
and extract any constant font sizes
found.
This makes it work out of the box with the printer demo.
2022-04-08 15:11:26 +02:00
Simon Hausmann
335502be3f
Upgrade to femtovg 0.3.4
...
The GL optimizations are in this release now and this also fixes #843
2022-04-07 13:56:23 +02:00
Simon Hausmann
143167f82f
Bump up the SPI frequency for the display controller ( #1115 )
...
* Bump up the SPI frequency for the display controller
2022-03-30 15:40:59 +02:00
Lukas Jung
b6171530ab
replace text_input_position_for_byte_offset with text_input_cursor_rect_for_byte_offset
2022-03-28 10:07:07 +02:00
Olivier Goffart
cf49568373
Compiler: make the image processing an enum in the config
2022-03-24 13:16:21 +01:00
Olivier Goffart
41b20fdd59
MCU build system: pass information about embedding images and glyph to the compiler
...
... using metadata from the build script send with the DEP_I_SLINT_BACKEND_MCU
Saves two environment variable that we don't have to pass
2022-03-24 13:16:21 +01:00
Olivier Goffart
5fb41f92d1
Update MCU readme a little
2022-03-23 11:15:44 +01:00
Olivier Goffart
eb9092ba15
MCU: run the timers
2022-03-18 18:51:29 +01:00
Olivier Goffart
ed60dcb6b5
MCU pico: increase heap size
...
So it doesn't do out of memory with the printerdemo_mcu in normal
usage
2022-03-18 09:33:23 +01:00
Olivier Goffart
8f4df47b1c
MCU pico: adjust the touch driver thresholds
...
The Press and Release threshold where inverted.
Also increase the Flickable threshold because the precision of the
touch screen is too low, and if the threshold is too small, we
can't click on things inside a Flickable
2022-03-18 09:33:16 +01:00
Olivier Goffart
66fa1fcfee
MCU readme: remove the scale factor
...
The new demo don't need it
2022-03-17 16:04:38 +01:00
Olivier Goffart
42947b3fe2
MCU renderer: Fix border radius bigger than the item
2022-03-17 07:34:23 +01:00
Olivier Goffart
3e7e575f41
Implement the length traits with generics
2022-03-17 07:34:23 +01:00