In some case, when the clip is, eg on a 0.25 of a pixel, but the offset is 0.75,
(such that the begining of the glyph starts at 0.5) difference in
rounding in different computation can result in a width which is one
pixel bigger than the source image.
I couldn't reproduce this in a testcase, but this can be reproduced
while resizing or scrolling through a TextEdit
I think this fixes#2957
The panic fixed by this commit looks like this:
```
thread 'main' panicked at 'index out of bounds: the len is 131 but the index is 131', /home/olivier/slint/internal/core/software_renderer/draw_functions.rs:81:19
stack backtrace:
3: i_slint_core::software_renderer::draw_functions::draw_texture_line
at ./internal/core/software_renderer/draw_functions.rs:81:19
4: <i_slint_core::software_renderer::RenderToBuffer<T> as i_slint_core::software_renderer::ProcessScene>::process_shared_image_buffer
at ./internal/core/software_renderer.rs:1023:13
5: i_slint_core::software_renderer::SceneBuilder<T>::draw_text_paragraph::{{closure}}
at ./internal/core/software_renderer.rs:1404:37
6: i_slint_core::textlayout::TextParagraphLayout<Font>::layout_lines::{{closure}}
at ./internal/core/textlayout.rs:219:17
```
We ended rendering glyphs with empty or even negative size, causing
panics down the line.
I added a way in the screenshot tester to change the scale factor
CC: #2957
This doesn't seem to be needed anymore with newer rust version.
As long as one symbol from the crate is used, all exported function
from the crate are available.
The reason why some symbols in some module were gone was a bug in rust
that has been fixed, it seems
* Configure clippy to not report about type complexity until *much*
later
* Configure clippy to only complain about more than 10 function
arguments
* Properly format safety sections
* Allow unnecessary main functions in doctests in the slint API crate
* AccessKit: Move big block of code before if condition
Otherwise we end up with outdated pre-edit data if we change focus while
editing.
Note: Qt doas actually send a "commit" event when the focus change
(but of course that does not happen when changing the focus within
slint)
But firefox does discard the preedit when loosing the focus.
CC #1925
AltGr on windos sends a left control pressed followed by AltGr pressed
on both winit and Qt. On AltGr release it sends left control released
followed by AltGr released.
So unset left control on windows once AltGr is pressed to avoid treating
special characters entered via AltGr key combos to be treated as control
sequences -- leading to the input being ignored!
Also treat `Alt-Ctlr-X` as `AltGr-X` on windows.
Fixes: #2933
We need only 9 different functions from fontconfig and one data
structure. We can do that interaction with libloading by hand and avoid
causing issues like servo/font-kit#212
The type of thep property is `Point`, which existed before. It was
mapped to `slint::private_unstable_api::re_exports::Point` (euclid) and
is now mapped to slint::LogicalPosition (also in C++).
Commit c8f1f4354b accidentally inverted
the target size computation logic when porting away from FitTo, scaling
to the tree width instead of scaling the tree width to the image element
width but preserving aspect ratio.
Fixes rendering of AboutSlint in gallery.
Note: the addition of MinimalSoftwareWindow::set_size is there because
it would be a breaking change for user who called set_size on the
MinimalSoftwareWindow while also using the WindowAdapter trait.
This was the case of a test.
The same problem theorically exist with set_position and position, but
is unlikely to be a problem because i don't think people would use the
position with a MinimalSoftwareWindow
The renderer() is now public as well. That's because I want to make sure
that the scealed trait don't have non-provided method