If the image has more pixel than 2^23, we could overflow when computing
the index.
Keep using usize for the index instead of `Fixed<i32, 8>`
Fixes#9136
- Implement @conic-gradient(color angle, ...) syntax
- Center is always at rectangle center (no center_x/center_y parameters)
- 0 degrees starts at north (12 o'clock position)
- Support Slint angle units: deg, rad, turn
- Software renderer: Full native implementation
- Qt backend: Native support with angle offset correction
- Skia backend: Native support with angle offset correction
- FemtoVG backend: Fallback to solid color (first gradient stop)
ChangeLog: Added support for `@conic-gradient`
Fixes#3957
Previously, the software renderer only supported linear gradients, with
radial gradients falling back to solid colors. This commit adds full
radial gradient rendering support.
Rename gradient-related types for clarity:
- GradientCommand → LinearGradientCommand
- gradients → linear_gradients
- draw_gradient_line → draw_linear_gradient
- process_gradient → process_linear_gradient
* tests: Add comprehensive screenshot tests for radial gradients
Add test cases for radial gradients including:
- Basic radial gradient with transparency overlay
- Multiple color stops with specific percentages
- Gradient stops beyond 100% range
- Overlapping transparent gradients with alpha blending
- Multiple stops at same position for sharp color transitions
- Edge case with invisible stop at 0%
ROTATION_THRESHOLD set to 600 due to imprecision in gradient calculations
during rotation transformations.
Instead of using datastructure that are tailored to our line by line
renderer and draw functions, use more generic and future proof data that
are easier to handle by hardware accelerator, and may be easier to
stabilize.
The screenshots from the screenshots test have to be re-done
because the rounding is different
Note: the C++ API DrawTextureArgs is not exposed yet
And call `extern crate std` when the feature is enabled.
I've read this is the good practice on how to do it.
So that the std prelude is no longer included automatically.
There is then less difference between std and and no-std build which
should avoid surprises in the CI when we use things from the prelude.
The downside is that there is a bit of churn in the tests
* WIP: swrenderer: use fixed point for the pixmap font coordinate
* swrenderer: signed distance field: move the glyph to the middle
* swrenderer: round the advance instead of truncating it in distance field
* swrenderer: actually align the gplyph on the sub-pixel precision
sub-pixel within the source.
* swrenderer: adapt the threshold for signed distance field
sqrt(2) is the distance to the diagonal, seems like this gives sharper fonts
* Fix bug in the elision, and re-upload the screenshort
the screenshot changed because the afvanced is now rounded intead of
truncated
Everything is already working, just had to play around with a few cfgs. The sharedfontdb module already takes care of including DejaVuSans as default fallback font.
The struct held provides access to the design metrics of the font scaled
to the font pixel size used by the element.
ChangeLog: Slint Language: Added font-metrics property to `Text` and `TextInput`.
Closes#6047
We were assuming that the extra clip was always on a unrotated image,
the rendering code didn't account for rotated screens
ChangeLog: Software renderer: fix artifact with partial drawing and rotation
Updated the version from 1.1 to 1.2
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
Only the hand-picked sensible things, not all of it ;-)
Also fix a few typos that cspell complained about when I
tried to commit and some formatting changes that cargo fmt
insisted on when commiting.
For tiling, we will need to know the actual source size in addition to
the scaling factor that can be different. So store the scaling factors
in the scene command, as well as an offset where to start.
This is more accurate in case of clipping and rotation.
For rotation that doesn't matter (appart from the fact that the testing
can now be more strict)
But for clipping this prevent glitches with partial rendering where it
would seem like the image are moving a bit by a pixel when it is redrawn
with a different clip
* Extend the cspell word list
* Remove those extensions from individual source files
* white-list licenses and such as we should not meddle with those
* Fix spelling