Commit graph

661 commits

Author SHA1 Message Date
Olivier Goffart
0598b3f095 The debug() function can now take several args, and debug more types 2021-06-01 14:10:25 +02:00
Simon Hausmann
5cad61bcd0 Fix disappearing text in vertical layouts with word-wrap and alignment
When a Text element has wrapping enabled, it should not have zero
minimum size. Otherwise the layout will give it a height of zero in the
layout in the test case and that'll make the text disappear. There are
different options but this patch goes for minimum height as if no
wrapping was enabled (so at least one line plus forced line breaks).

Fixes #246
2021-06-01 10:52:26 +02:00
Olivier Goffart
4b00f42324 Fix clicking on the home page in the interpreted printerdemo
Turns out the declared `clicked` callback was overriding the TouchArea one
since the refctor of the interpreted global components
2021-05-28 18:32:05 +02:00
Simon Hausmann
cc9d5e09f0 Add support for clip on Path elements
This allows clipping the viewbox conveniently.
2021-05-21 19:51:00 +02:00
Olivier Goffart
edfa6319b2 Fix alias to globals with the interpreter 2021-05-21 16:03:57 +02:00
Olivier Goffart
1aed36d122 Be sure to propagate the fact that properties are changed for aliases 2021-05-21 10:06:26 +02:00
Olivier Goffart
a071738a4a Fix initialization order of globals 2021-05-20 13:40:51 +02:00
Olivier Goffart
6fae458c2d Properly merge analysis of base component 2021-05-20 13:40:51 +02:00
Simon Hausmann
a7ce64657c Restore source compatibility for drop-shadow-blur
Let's keep source compatibility and define `drop-shadow-blur` to be a radius.
The CSS spec says that the standard deviation is half of the radius.

We just need to scale again and increase the shadow rect to make sure that no borders are visible.
2021-05-20 12:14:05 +02:00
Simon Hausmann
bb7b301b10 GL backend: new box drop shadow implementation
This replaces the box gradient with a new implementation that
behaves like the HTML Canvas element, by applying a gaussian
blur to the alpha of the rectangle to shadow.

The drop-shadow-blur property is changed to be now just a "level", like
the HTML Canvas shadowBlur property, which is defined to be half of the
standard deviation of the gaussian blur to be applied.
2021-05-20 08:50:02 +02:00
Olivier Goffart
27ab119233 Updater test: fix the whitelist when there are warnings
We should ignore the failing test if all errors are ignored.
warnings don't count
2021-05-18 19:01:55 +02:00
Olivier Goffart
54e77e8583 Updater test: ignore binding loop error
The updater can't fix these
2021-05-18 18:32:26 +02:00
Olivier Goffart
76a42cd757 Added support for static constant z ordering
Just re-order the children at compile time
2021-05-14 16:17:34 +02:00
Olivier Goffart
c91ea3f615 interpreter test: In case of failure of the test, dump all properties 2021-05-11 14:59:57 +02:00
Olivier Goffart
539a78e807 Rust: implement enough of PathLayout so that the tests passes
(does not implement the repeater case)
2021-05-11 14:59:57 +02:00
Olivier Goffart
f99d7de5ad Fixup layout in rust 2021-05-11 14:59:57 +02:00
Olivier Goffart
720001a223 Remove the solve_layout from the component vtable
no longer required
2021-05-11 14:59:57 +02:00
Olivier Goffart
e7d7589538 Decent default binding for the materialized constraints 2021-05-11 14:59:57 +02:00
Olivier Goffart
a990e01cd8 Apply the layout restrictions to the parent element 2021-05-11 14:59:57 +02:00
Olivier Goffart
c6103aa9ce Fix image geometry in layout
since the layout now sets an explicit width and height, we check the priority
to see the difference between something explicitly set, and something set by the layout
2021-05-11 14:59:57 +02:00
Olivier Goffart
b463e3cca4 WIP refactor layout
This commit add support for the box layout
2021-05-11 14:59:57 +02:00
Olivier Goffart
21a80f4562 WIP: Layout refactoring
Instead of using a solve_layout function in the component, use property to hold
a layout cache.

This commit only implement the GridLayout and only the interpreter part
2021-05-11 14:59:57 +02:00
Olivier Goffart
304699e6bc Fix C++ tests on windows 2021-05-11 11:40:26 +02:00
Olivier Goffart
675528bfb9 Run the integration test also on windows
The code that extract the rust/cpp/js snippets from the testcases
did not work on windows because of the different newline character
2021-05-11 11:40:26 +02:00
Olivier Goffart
7f7f2245d8 Use the testing backend for node 2021-05-11 11:40:26 +02:00
Olivier Goffart
988c2b0b9d Use the testing backend for the C++ integration tests 2021-05-11 11:40:26 +02:00
Olivier Goffart
a0e910abf0 Use the testing backend for rust 2021-05-11 11:40:26 +02:00
Olivier Goffart
662c52abff Introduce a "testing" rendering backend and use it for the interpreter test
This way the tests can pass even if the tests would otherwise need a running
window, like they do with the GL backend
2021-05-11 11:40:26 +02:00
Olivier Goffart
e074d7ce89 Fix panic when aliases are merged with property in another component 2021-05-07 17:15:45 +02:00
Olivier Goffart
0083bd8d23 Fix return statement in the C++ generated code
The template parameter of the ReturnWrapper could be deduced to
a wrong type (eg: int instead of float) so we must add it explicitly
2021-04-27 10:17:09 +02:00
Olivier Goffart
feadcfa25a Update cbindgen 2021-04-23 16:18:52 +02:00
Olivier Goffart
1f64f7ab27 Also set the preferred size for the GridLayout
Issue #182
2021-04-21 18:56:28 +02:00
Olivier Goffart
8ac0fe78ad Test for the interpreter 2021-04-21 17:15:19 +02:00
Olivier Goffart
14772a9b58 Handle reduction of logical lenght when the units are more complex 2021-04-21 17:15:19 +02:00
Olivier Goffart
91ed04a72c Make length (still the default for all property) be the logical length
And a new `physical_length` is now the physical_length unit

Note: this does not change the runtime part yet
2021-04-21 17:15:19 +02:00
Simon Hausmann
dbfa5cadde Fix text rendering with path-clipping
When rendering into a layer, we applied the y coordinate system flip
using a transform. That transform is incompatible with
Canvas::fill/stroke_text, which uses transform_point to transform the
glyph quads. That appears to not work, as opposed to the
y-flip in the main vertex shader.

Fortunately we can work around it by doing the flip when rendering the
layer image (as part of the fill).

Closes #199
2021-04-20 22:25:59 +02:00
Simon Hausmann
f50d573120 GL backend: Add support for path clipping, used for rounded rects
Render the sub-tree of items into an intermediate image and fill the
clip path with that image.

Fixes #199
2021-04-20 10:26:11 +02:00
Olivier Goffart
862f65c151 Fix panic in the interpreter when accessing uninitialized global
As the type of the Value wouldn't match the expected type

Fixes #173

(Also added a way to test the interpreter by making the interpreter
make sure the property "test", if it exists, is true)
2021-04-19 11:41:36 +02:00
Olivier Goffart
87f4a363cf Add support for opacity property 2021-04-15 15:05:09 +02:00
Olivier Goffart
aeff269bd4 Fix another panic caused by some NamedReference of the layout not being visited 2021-04-14 17:23:33 +02:00
Olivier Goffart
b7f3f39143 Test for previous fix 2021-04-14 16:15:14 +02:00
Olivier Goffart
27ac4f4fc7 Move a testcase in its own folder 2021-04-14 15:48:42 +02:00
Simon Hausmann
48e6d2f48b Fix handling of non-zero border width in clip-enabled Rectangles
The border should be visible (as in the included test case), which this
patch fixes for Qt by subtracting the border width just like when drawing.
2021-04-14 13:34:51 +02:00
Olivier Goffart
e8e0bcb4d0 interpreter test: try to load the examples 2021-04-13 09:49:32 +02:00
Olivier Goffart
380b421507 Fix warning in test 2021-04-12 15:42:58 +02:00
Olivier Goffart
e67deebc76 Make rgb() and rgba() a macro that can take 3 or 4 arguments
and that accept both percent or integer

Closes #139
2021-04-12 15:19:15 +02:00
Olivier Goffart
ca64a540c4 Continue support for rgb() function
Fixup of previous commit which was part of https://github.com/sixtyfpsui/sixtyfps/pull/139
2021-04-12 15:18:25 +02:00
Olivier Goffart
366ce83dae Fix crash with repeater in a Flickable 2021-04-12 10:35:30 +02:00
Olivier Goffart
563866a60f Remove debug assertion that is not always true
because Int32 and Float32 can be compared but aren't the same type
2021-04-09 19:28:32 +02:00
Olivier Goffart
b45190ca2d Flickable geometry
Issue #192
2021-04-09 19:14:48 +02:00