Simon Hausmann
0f0055b87c
Cleanup in the expression resolution pass
...
It turns out that we don't need the type registry :-)
2020-07-15 13:28:56 +02:00
Simon Hausmann
5b43962bb2
Split up TypeRegistry
...
For a .60 files the locally defined components are now stored in a separate
per-document TypeRegistry instance that falls back to the global registry
for lookups.
2020-07-15 13:09:43 +02:00
Olivier Goffart
24033ecdc3
Support for logical_lenght type
2020-07-15 11:53:19 +02:00
Simon Hausmann
719bff4eca
Minor cleanup
...
Don't require a mutable type registry for the compiler passes.
2020-07-15 11:25:28 +02:00
Simon Hausmann
8b2ff87db9
Minor cleanup
...
Don't concatenate paths as strings with directory separators, use the
variant to create from an iterator. This could also be cannonicalized,
but it's not necessary AFAICS.
2020-07-14 22:12:31 +02:00
Olivier Goffart
8e7e3aaa7a
Make the length its own unit
2020-07-14 17:45:03 +02:00
Olivier Goffart
4b20bf97ef
Add px unit in many places
...
(This was done automatically with the updater)
2020-07-14 17:14:59 +02:00
Simon Hausmann
0fd3680542
Small typo fix
2020-07-14 16:48:10 +02:00
Simon Hausmann
855be51e82
Fix PropertyAnimation field population in Rust generator
...
Correctly use a separating comma when there are multiple bindings. This
also revers commit bcf5609d73
.
2020-07-14 16:33:54 +02:00
Olivier Goffart
952ddda7c4
Force duration to have an unit
2020-07-14 16:18:12 +02:00
Simon Hausmann
bcf5609d73
Avoid test failure
...
Work around a problem with specifying multiple properties in property animations.
While trying to find what the problem is
and how to fix it, this patch avoids the
test failure in the CI.
2020-07-14 16:12:22 +02:00
Simon Hausmann
39359a4e26
Add support for an offset to PathLayout
...
This allows animating items on their position along the path.
2020-07-14 15:12:03 +02:00
Simon Hausmann
1845e495fe
Fix path layout positioning
...
The local parameter t on a path segment wasn't normalized to the length
of the segment itself.
2020-07-14 14:23:43 +02:00
Simon Hausmann
f8024e6658
Add support for looping in animations
2020-07-14 13:22:28 +02:00
Olivier Goffart
c30aa370f3
Parse units
...
They currently have no real meaning
2020-07-14 11:35:45 +02:00
Simon Hausmann
a3f365417c
Center items on a path layout
2020-07-14 09:43:59 +02:00
Olivier Goffart
e00491811b
Get rid of the context in properties/signal
2020-07-13 18:49:06 +02:00
Olivier Goffart
ab7ae9f3e2
Some refactoring of the rust generated code
...
Always use a Pin<Rc> for the component. (This is required to support repeater
within repeater as well anyway)
Do not use the context within the binding. We can get along by simply capturing
a weak pointer to the component
2020-07-13 16:37:54 +02:00
Simon Hausmann
1a0d053889
Align default path layout tolerance
...
Use the same tolerance as when rendering
2020-07-13 16:12:38 +02:00
Simon Hausmann
992f990fa8
Allow for fitting paths into a given bounding rectangle
...
... by applying a transformation. This allows designing a path in some
other path design tool and then make it fit using bindings.
2020-07-13 15:41:11 +02:00
Simon Hausmann
79ba943882
Allow for positioning grid layouts as well
2020-07-13 14:02:53 +02:00
Simon Hausmann
f6761e2c4c
Allow for the positioning of PathLayouts via x/y properties
...
These are just "virtual" properties that will be transformed into
property members of the main struct through the optimized elements
sub-pass.
2020-07-13 13:34:04 +02:00
Simon Hausmann
e78dd1342a
Fix optimized elements pass
...
Apply the move of bindings and properties also to the optimized elements themselves.
2020-07-13 13:30:55 +02:00
Olivier Goffart
868468b101
Interpreter: Do not use the parent component from the context
2020-07-13 13:13:23 +02:00
Olivier Goffart
d392e00c1c
Implement dynamic models in the interpreter
2020-07-13 11:50:57 +02:00
Olivier Goffart
905dca7d19
Remove debug output
2020-07-13 11:50:39 +02:00
Olivier Goffart
c3d4a0fe4a
Add the if.60 testcase
2020-07-13 11:40:16 +02:00
Simon Hausmann
6243df1702
Avoid unnecessary path building
...
When the path was constructed from events (SVG commands), then we don't really need to build an intermediate path,
neither for rendering nor for path layouting.
2020-07-10 13:59:40 +02:00
Simon Hausmann
535da41ae0
More naming cleanups
...
PathData::PathElements has one redundant "Path" in the name, so eliminate
for Events and Elements.
2020-07-10 13:06:28 +02:00
Simon Hausmann
7c4b12a0ce
Remove unused path event data structures
2020-07-10 13:02:12 +02:00
Simon Hausmann
1f7ae1b318
Rename PathElements to PathData
...
as it can now consists of elements or events.
2020-07-10 13:01:05 +02:00
Simon Hausmann
69325a1a5b
Get rid of PathElements::StaticElements
...
This functionality can be folded into SharedArray later, if needed.
2020-07-10 12:47:27 +02:00
Simon Hausmann
ad98ae65ae
Avoid unnecessary path building
2020-07-10 10:24:36 +02:00
Simon Hausmann
4b6e549b96
Simplify compiled path data structure
...
Use two arrays, one for events and one for coordinates. That simplifies
the code generator and the generated code, and it also provides for
a more compact memory representation.
2020-07-10 10:20:59 +02:00
Simon Hausmann
264b1f650f
Use std::size instead of hand-written version
...
Less is more :-)
2020-07-09 15:40:01 +02:00
Simon Hausmann
1a70213c05
Fix path layout implementation to allow positioning
...
This is not exposed in the API yet though.
2020-07-09 15:38:26 +02:00
Simon Hausmann
4b75ec0ee8
Lay out items on a path
...
This works, but it's still missing support for positioning of the layout
itself.
2020-07-09 15:32:47 +02:00
Simon Hausmann
8edb9bd7f8
Implement a layout function to position items on a path
...
This is very simple still, always starts at the beginning of the path
and uses equal distances.
2020-07-09 15:26:52 +02:00
Simon Hausmann
a679f33871
Process path elements in PathLayout
...
Collect them and assign them to an "elements" property, like with Path {}.
Also process paths before layouts.
2020-07-09 14:18:27 +02:00
Simon Hausmann
5e8d23a287
Accept PathLayout just by syntax
2020-07-09 14:18:26 +02:00
Simon Hausmann
251ef7fc97
Add support for SVG commands in Path elements
...
Using the commands property we can just paste SVG paths. This makes it
much easier to write examples/demos. A good online path designer is
for example https://codepen.io/anthonydugois/pen/mewdyZ
2020-07-09 13:41:57 +02:00
Simon Hausmann
be60079f21
Add support for pre-compiled paths
...
They are represented as lyon-style path events. We can use this to
compile SVG paths ahead of time and use them
without including lyon's SVG path builder.
2020-07-09 10:43:49 +02:00
Simon Hausmann
c17c06c6e7
Making closing of a path optional
...
By default paths are not closed and they can be closed using a Close {}
element.
2020-07-09 09:52:09 +02:00
Simon Hausmann
f45ff6ce79
Add support for stroking paths
...
This will make it easier to visualize the path for layouts.
2020-07-09 09:36:16 +02:00
Simon Hausmann
dfe95a2f6d
Allow rendering primitives to break down into multiple GL primitives
...
This is in preparation for path stroking and filling.
2020-07-09 09:10:55 +02:00
Simon Hausmann
5629683942
Remove PathElements::as_slice()
...
This function is not needed anymore
2020-07-09 08:54:19 +02:00
Simon Hausmann
afa23faa94
Move the path building function into corelib
...
We're going to need it not only in the GL renderer but also in the layout code.
2020-07-08 20:36:40 +02:00
Simon Hausmann
7c8cd63ddc
Fix formatting
2020-07-08 20:26:28 +02:00
Simon Hausmann
32f9f4117f
Upgrade to a new upstream glow version
...
This includes our fix for the texture creation from canvas, and requires
a little source compatibility fix.
2020-07-08 20:25:40 +02:00
Simon Hausmann
8c7068ebfc
Fix spurious test failures with type hierarchies
...
Make sure the error output is always the same and doesn't depend on the randomness
of HashSet.
2020-07-08 10:24:13 +02:00