* Change SharedVector::as_mut_slice() to SharedVector::make_mut_slice()
* SharedPixelBuffer::as_mut_slice and SharedPixelBuffer::make_mut_slice()
* SharedPixelBuffer::as_bytes_mut() to SharedPixelBuffer::make_mut_bytes()
This is consistent with Rc::make_mut() and is supposed to emphasize
that, unlike the usual as_* operations, it is not a free operation but
may involve work (detaching the data by cloning it).
Amends commit 7384ebdc32
There's only one place where we need this ourselves and that's also
easily done by hand. Otherwise the `as_bytes(_mut)()` accessor provides the
functionality along with `width()` and `height()`.
Other than that the API is mostly consuming, given that `sixtyfps::Image`
has no way of extracting the data again.
This adds an ImageBuffer and PixelBuffer type for SharedVector
backed images. The documentation explains how to use this
with low-level rendering functions and the popular image crate.
Fixes#387
If a Rectangle has a border-radius and clipping, we use an FBO to render
the children and then use femtovg's stencil clipping. If the Rectangle
has a zero width or height, we would end up trying to create a texture
with such dimensions, which produces run-time opengl errors.
We can detect this situation and avoid it early on. The same might happen for shadows.
Fixes#377
When the text selection end follows right after a grapheme that uses less
glyphs than characters, then there may not be a matching glyph with the byte
index, therefore we wouldn't set the selection_end_x and draw incorrectly.
Take the visual tail of the last glyph then.
We calculate the cursor position as byte offset in the utf-8 encoded string,
while Qt expects an index in the utf-16 encoded QString.
When those differ, the cursor is rendered at the wrong location.
Fixes#363
This requires some gymnastics to get right as the information
need to be passed to the compiler despite having no direct dependency
between the compiler and the runtime or backends.
So use a file in the build directory to tell the default style
cc: #83
Add the icon type explicitly to make it easier to do "eye" based type matching with the cpp! macro.
Co-authored-by: Olivier Goffart <ogoffart@sixtyfps.io>