560 Commits

Author SHA1 Message Date
159a6850cc chore: increase http package range
This is my fault, I should have done this when I initially bumped the http package to support a wider range to ensure our package plays well with other packages that rely on the HTTP package.

The 1.0 HTTP release also bumped the minimum Dart version to 3+

Normally if this is a problem for someone they can manually provide a dependency override if they want to use an older version of the HTTP package, but this is a problem for Flutter Flow users that want to create a custom widget and add Rive as a dependency, as certain FF dependencies are using the older version of HTTP.

Diffs=
9e40f95e5 chore: increase http package range (#6099)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-10-17 12:54:34 +00:00
284afd6414 Xxxx nested inputs fixes
Diffs=
c583c4e5b Xxxx nested inputs fixes (#6098)
8b7dd980b patch up division by zero issue on normalizing Length (#6095)
8c99c8dcf Android Out of Band Assets (#6019)

Co-authored-by: hernan <hernan@rive.app>
2023-10-17 01:43:46 +00:00
c6f1ae4cff Removed single-threaded counter.
This counter type is single-threaded and makes all objects using it thread-unsafe.

Diffs=
6a74a01f2 Removed single-threaded counter. (#6090)
b4ef09a6d Removed Cargo workspace dependencies. (#6089)
c63346b93 Fission the CG and Skia renderers (#6071)

Co-authored-by: Dragoș Tiselice <dragos@rive.app>
2023-10-13 15:11:10 +00:00
e617da4f74 Nested Inputs
This PR adds support for setting NestedInput values from a parent artboard. We should support NestedBool, NestedNumber and NestedTrigger. After discussion with @alxgibsn there are at least 4 editor UI updates required to work together with this feature.

- [x] Add a `public` boolean to StateMachineInput that allows you to specify whether the input should be available outside of its own artboard. This is presented in the motion inspector when a StateMachineInput is selected.
- [x] Surfacing Nested Inputs in the Inputs panel alongside the Inputs for the current artboard. We also need a way to differentiate Nested Inputs from regular Inputs (possibly a folder-like hierarchy).
- [x] Surfacing Nested Inputs in the Inputs list for a Listener.
- [x] Surfacing Nested Inputs in the NestedArtboard StateMachine flyout. Looks like this work has already been done!
- [x]  Get NestedTrigger working

Diffs=
45359b3e8 Nested Inputs  (#6007)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2023-10-11 22:23:08 +00:00
672dbf976e Add support to Listeners for events from nested artboards
- Propagate events up to parent Artboard state machines
- Add Event to Listener types and display in combobox
- Add support for StateMachineListeners to listen for events

Still needs implementation on CPP runtime.

In this example, the rectangles are in a nested artboard. Clicking them fires an event from the nested artboard up to the parent artboard which has a listener which updates an input triggering the animation.

https://github.com/rive-app/rive/assets/186340/22bfb00e-8d1e-46f0-8faa-d2d5e5a1bbfb

Diffs=
1a9dd7e97 Add support to Listeners for events from nested artboards (#5923)
52a1a6f88 Added a Rust runtime. (#6027)
22077beda feat: add count and query APIs for events and text runs at the Artboard level, and expose in WASM (#6043)
f95f54140 Add out of band loading to rive-wasm (#6017)
54d736fec 6041 follow path with 0 opacity (#6060)
bb7d5ac4c Add a math::round_up_to_multiple_of<N>() utility (#6061)
6ee7cea9e Clamping color stops. (#6052)
bb00ec119 Add a WebGPU mode that uses EXT_shader_pixel_local_storage (#6048)
af873d55a update runtime with file asset cdn information (#6040)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2023-10-11 21:22:17 +00:00
bd54862d72 chore: prep flutter runtime for release v0.11.17
- Checks to see everything is working
- Fixes a few analyser warnings and updates CHANGELOG

Diffs=
399ef7716 chore: prep flutter runtime for release v0.11.17 (#6011)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-09-19 18:50:22 +00:00
64a335e20c Fix issue with timeline events on first frame
Events that fire on the first frame (with a work area too) were not reporting. This was because the way we look for occurred events wouldn't catch an event that started at the same time as the playhead as presumably that would've been caught on the previous frame. This falls apart when the animation starts on the same frame as the one where an event (or multiple) are triggered.

Adds a fix by detecting this condition and a bunch of tests in both C++ and Dart for it.

Also revs the lightning bolt animation in the editor for triggering the event as this showed an issue with state contention in its state machine.

Diffs=
382a48cf8 Fix issue with timeline events on first frame (#6006)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-09-19 02:46:23 +00:00
98040494a8 feat: expose wrapper event class to runtime
The goal of this PR is to improve the usability of events for the Flutter runtime and to hide unnecessary editor implementation detail. This also ensures that an event is not modifiable after it has been reported (from the runtime's perspective)

This is achieved by exposing runtime specific classes `RiveEvent`, `RiveOpenURLEvent` and `RiveGeneralEvent` (similar to the other runtimes), and mapping the current `Event` to these classes as an immutable object. It also maps the list of events to a Map called `properties`.

This PR also:
- Adds more event examples and fixes the audio example (`.stop` resulted in issues, and calling dispose, etc.)
- Adds tests for events

TODO:
- Will need to potentially change things (and expose the `delay`) when this lands: https://github.com/rive-app/rive/pull/5951

Diffs=
eae01824d feat: expose wrapper event class to runtime (#5956)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-09-18 17:54:53 +00:00
acdcb4ef2f Event fixes
Addresses issues brought up here:
https://2dimensions.slack.com/archives/CLLCU09T6/p1694766559770229

- Custom properties not updating when expected.
- Events not firing on first frame.

One important aspect of all of this:
- Custom properties on events update with LinearAnimation.apply.
- Events on timelines and state machines accrue/report during StateMachine/LinearAnimation.advance

These could happen when the state machine would transition to a layer with an animation. The first frame would apply with mix 0 meaning all non-mixable properties wouldn't be applied per https://github.com/rive-app/rive/pull/5960/files.

I took a slightly different approach. Now apply will always try to apply values. If mix is 0, non mixing properties will apply. I think semantically this makes more sense too. If you don't want to apply, don't apply. Apply with mix 0 is effectively a no-op as we had it before, so it was just a perf suck.

So I re-worked the various call sites for apply to not call it when attempting to mix in an effectively mixed-out animation. This has one caveat for blend states. Because the blend state advances all the animations in sync, .advance must still be called when mix is 0, so events will still report but custom property keyframes in mixed out animations will not update. I think that's reasonable, but may not be immediately apparent. We can opt to not report events when the mix is 0 by introducing a "reportEvents" boolean to advance, or add an option to the blend state for whether or not they should report.

Diffs=
236d788ea Event fixes (#5997)
05e1afaf3 Bump the iOS minimum version to 13 on native builds (#5989)
0dcbdade4 add artboards shapes to updates when RenderOpacity has dirt (#5971)
85b2b6ed1 Read passed any empty runs when iterating glyphs. (#5974)

Co-authored-by: Alex Gibson <agibson.uk@gmail.com>
Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-09-15 22:11:30 +00:00
e95a35f710 Don't apply id keyframes when mix value is 0
Addresses an issue where mixing animations of a nested artboard from it's parent artboard can produce unexpected results when dealing with id based keyframes (such as active solo or draw rules). The proposed solution ignores applying an id keyframe's value to an object if the mix value for that animation/keyframe is 0. This provides a way to turn "off" an id based keyframe during a mix.

Behavior AFTER this update. This example has an artboard with 2 animations that each have different values for active solo and a draw rule that is on or off. This artboard is nested in another artboard which sets the animation mix as seen in the recording.

https://github.com/rive-app/rive/assets/186340/b67e98c8-ab7c-4a92-ab3b-65d27b0eadbd

Behavior BEFORE:

https://github.com/rive-app/rive/assets/186340/c0a6c558-efc4-43ec-8974-57bf8f6ab3e8

Diffs=
b9382846d Don't apply id keyframes when mix value is 0 (#5960)
f96c86fcc Timeline Events for runtime (#5951)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2023-09-12 16:14:29 +00:00
c6791d7b6d Timeline events & Core Callback type
Introduces a new Core field type which does not produce stored fields. Instead it provides a callback which can be keyed and unique per type so time based events can trigger against their property keys.

This is to allow things like nested trigger inputs and triggering events from the timeline.

Draft as there's a bunch more work to do for actually invoking them from the StateMachine & LinearAnimations. In the meantime the tests can do some sanity testing.

- [x] Generate core types that do not produce stored fields.
- [x] Massage Keyframe hierarchy to allow for non stored value Keyframes (markers for trigger).
- [x] Key those core types with specialized keyframes.
- [x] Pass context (like StateMachine) to those triggers and see it all tie together.

Diffs=
6058b52ce Timeline events & Core Callback type (#5877)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-09-05 20:14:25 +00:00
94c7847bb0 Publish new version of rive_common.
Fixes https://github.com/rive-app/rive-flutter/issues/340

Diffs=
4892035f5 Publish new version of rive_common. (#5946)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-09-05 19:36:01 +00:00
2022de3092 Published Flutter 0.11.16
Diffs=
4be3c364b Published Flutter 0.11.16 (#5941)
853ae7de1 Fix keepGoing when a work area is used. (#5939)
33aec1b20 Make Mat2D constructors constexpr (#5932)
4335a2cd2 Fixed runtime to compile with gcc. (#5870)
c6b867df9 Allow setting text to completely empty. (#5924)
06a187288 Make RenderBuffer mappable (#5907)
654d4488e Add a macro to create bitsets from enums (#5922)
7bbf083ce Add some joystick flag tests. (#5921)
d35df0427 Delete the copy constructor from Mat2D (#5916)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-09-01 23:27:50 +00:00
f9cc0f968a Treat all Constraints and ClippingShapes differently than children when propagating collapse
Decided to go with the `is` check because it seems like all types of Constraints or ClippingShapes should follow this behavior now and in the future.

Diffs=
16cf8082f Treat Constraints, ClippingShapes and DrawRules as special Solo child types (#5897)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2023-08-25 23:50:35 +00:00
7222e458c8 Improve collapse propagation for solo.
Fixes https://2dimensions.slack.com/archives/CLLCU09T6/p1692895941301969

Should also address #5888

Basically we were propagating the collapse to the ClippingShape for the solo which meant that the update on the clip was never called. This meant the path would never be generated and so our contents would always get clipped out (no intersection with an empty path).

ClippingShapes and Constraints should be treated more like siblings (or properties) of the Solo instead of children that can be collapsed by the active solo child choice.

Diffs=
e1b9d360b Improve collapse propagation for solo. (#5890)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-08-25 00:09:51 +00:00
c517e49ebf make custom workflow to see whats happening wiht flutter
Diffs=
ab5745943 Update files to use git lfs (#5883)
2719b1463 early out of advance if we are not going to keep goign (#5849)

Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
Co-authored-by: Philip Chung <philterdesign@gmail.com>
2023-08-24 15:32:54 +00:00
174048e3ee Don't collapse child constraints of Solos
Fixes the problem where FollowPathConstraints were not working with Solos in CPP runtime (works only in editor). The proposed solution is to not collapse constraints of the Solo because in the case of FollowPathConstraint, a call to it's update() is required in order to get the path info.

Before the fix:

https://github.com/rive-app/rive/assets/186340/48df0eb5-a422-464c-84c0-4c49412fa90e

After the fix:

https://github.com/rive-app/rive/assets/186340/dbfc8172-217d-4685-92c8-c34c551235ca

Diffs=
a91b1b764 Don't collapse child constraints of Solos - fixes Follow Paths on Solos (#5866)
033489f8b Fix follow path contention with MetricsPath (#5868)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2023-08-24 05:31:50 +00:00
278695858d Choose events to fire on State and Transition start/end.
Allows selection of event and when to fire it per state and transition.

On a state:
![CleanShot 2023-08-16 at 22 28 32@2x](https://github.com/rive-app/rive/assets/454182/34c49212-6638-4187-91ed-d99042cc5a2a)

On a transition:
![CleanShot 2023-08-16 at 22 28 53@2x](https://github.com/rive-app/rive/assets/454182/d7bcbcbf-6719-4c5f-9a2a-cfee491ac718)

I also kept getting the annoying combo-box stuck at the bottom of the screen with these combos so low to the bottom right, so I fixed that too. Which helps the text combos too. Popups with predictable heights will try to open in the direction where they'll have most vertical space:
<img width="570" alt="CleanShot 2023-08-16 at 22 30 02@2x" src="https://github.com/rive-app/rive/assets/454182/88802e09-04df-4256-b4c1-2cc2bf490fcd">

Diffs=
ad4236501 Choose events to fire on State and Transition start/end. (#5830)
abe5aab14 Added a Vello back-end with a custom winit viewer. (#5786)
adeebb26a Implement drawImage() in PLS (#5780)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-08-18 19:49:16 +00:00
4780d19c3a Event triggering
Explores an API for triggering events and querying them at runtime.

For Flutter we expose an onEvent callback that you can add a callback to on the StateMachineController:
```dart
final controller = StateMachineController.fromArtboard(artboard, 'bumpy', onEvent: {);
controller.onEvent = (event) {
  // Do something with event. Like:
  if(event is OpenURLEvent) {
    launchUrl(event.url);
  }
};
artboard.addController(controller!);
```

Note that I haven't piped onEvent to the Flutter runtime yet but you'll see it in the StateMachineController in core.

In C++:
```c++
auto count = stateMachineInstance->firedEventCount();
for(auto i = 0; i < count; i++) {
  auto event = stateMachineInstance->firedEventAt(i);
  if(event->is<OpenURLEvent>()) {
    // Do something with the url.
    auto url = event->as<OpenURLEvent>()->url();
  }
}
```

You can see some of this in action in the state_machine_event_test.cpp.

You can also see the events in the console in the editor:
<img width="717" alt="CleanShot 2023-08-10 at 18 03 22@2x" src="https://github.com/rive-app/rive/assets/454182/af21902a-424d-435b-b5b0-2a43701fe186">

In a follow up PR:
- Ability to trigger events from State (in/out) and Transition (start/end).
- Add custom properties to Events C++ API (currently they are loaded but not tracked against their respective events).

Diffs=
8caa7d377 Event triggering (#5793)
e71ae68ba  Fix issue with nested artboards not updating follow path constraints. (#5810)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-08-14 19:17:57 +00:00
7cb217b980 test: automated golden tests
Any riv added to `test/assets/batch_rive` will automatically be tested. The test includes:
1. Setting up the animation to play the default state machine
2. Render first frame
3. Advance by three quarters of a second
4. Advance by two seconds

Diffs=
7c3f77dd6 test: automated golden tests (#5785)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-08-10 15:13:47 +00:00
1da10ef040 fix: remove default font from flutter runtime
Removing the default font logic from the runtime, because:
- Flutter Web will console log an error trying to load the default font from a URL
- `rootBundle` prevents tests as it cannot be spoofed.

Diffs=
b905380c9 fix: remove default font from flutter runtime (#5783)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-08-10 13:46:04 +00:00
047c6ab39a chore: add git lfs to flutter test runner
Diffs=
d5162f1e1 chore: add git lfs to flutter test runner (#5782)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-08-10 12:29:21 +00:00
07665f3cc9 update mono to apply .gitattribute changes first & made a trivial cha…
…nge in rive_flutter to push downstream

tested this on a couple of private repos.

this also ran a linter on mono.sh 🙈 i guess that should be fine though

Diffs=
96a0f0b96 update mono to apply .gitattribute changes first & made a trivial cha… (#5781)
cbc6ba291 Add rive::math::msb() (#5777)
58cc49580 Add a Bitmap::detachBytes method (#5763)
30351d475 Letter spacing! (#5774)
e6941215f refactor: use ticker instead of stopwatch (#5761)
3ab062dd2 Run editor tests on hosted runner. (#5760)

Co-authored-by: Alex Gibson <agibson.uk@gmail.com>
Co-authored-by: Gordon <pggordonhayes@gmail.com>
Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2023-08-10 10:33:33 +00:00
59b73de9b7 refactor: hit testing
- Moves the hit testing logic from `RiveAnimation` to the `Rive` render box instead. Setting the default to be false, and users have to opt in to enable it. This is to ensure we don't break code for anyone that currently handles their own pointer logic, and also to avoid unnecessarily doing work if it's not needed.
- Add onEnter and onExit to resolve https://github.com/rive-app/rive-flutter/issues/284
- Adds ability to set cursor (this had to be overridden to allow for onEnter/onExit) and makes sense to expose publicly. Note though that this will be for the entire render box area. It won't work for "part" of an artboard that has a listener. Though we could look into adding that in the future.

Diffs=
2eb7308d2 refactor: hit testing (#5731)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-08-08 13:21:09 +00:00
7bf4ec8fda Fix loading init text in Flutter runtime.
The important work is done in _initTextAndImport. This functionality needs to be called by the user if they call RiveFile.import. See the changelog for some notes.

I needed to bump rive_common for this to work as we manually added our fixRequireJs fix to the HTML. We should always try to inject functionality that's required at runtime dynamically so it can apply to all apps (not just our editor).

Diffs=
d072cbde0 Fix loading init text in Flutter runtime. (#5758)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-08-07 18:55:50 +00:00
a2bb7294c6 Updating rive_common and rive_flutter with memory leak fix.
Rolls fixes from https://github.com/rive-app/rive/pull/5752 into the editor via rive_common and updates rive_flutter to use the latest rive_common.

Diffs=
133fe44e4 Updating rive_common and rive_flutter with memory leak fix. (#5753)
2f67af55f fix leak in move operator= on SimpleArray (#5752)
b3a367dad Make rive_decoders compile on Windows (#5733)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-08-05 15:36:27 +00:00
afe42b0998 Clipping and baseline
The way we were computing the bounds for clipping was off which also exposed it was off in the runtime for transform constraints! This was also breaking the Lottie converter.

Now the origin, baseline, bounds, and clipping all look right in Flutter + C++. Goldens would help here too @mjtalbot

<img width="1152" alt="CleanShot 2023-08-02 at 11 50 36@2x" src="https://github.com/rive-app/rive/assets/454182/5b7d580e-9d82-4e7b-8b91-7155a2c89fa6">

Fixes #5732
Fixes issue discussed here: https://2dimensions.slack.com/archives/CLLCU09T6/p1690977600095549

Diffs=
d3e75b38d Clipping and baseline (#5734)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-08-02 20:30:01 +00:00
8c12763c6b docs: add awesome-rive to README
Diffs=
50f10716b docs: add awesome-rive to README (#4866)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-08-02 18:30:30 +00:00
4134e1961d Enable animation for Text Run style prop
<img width="262" alt="CleanShot 2023-08-01 at 10 17 31@2x" src="https://github.com/rive-app/rive/assets/8057513/ee375ef9-7a23-418b-81a2-6f38bc102200">

Diffs=
da909105a Enable animation for Text Run style prop (#5726)
2023-08-01 21:40:44 +00:00
b6fbd4fe9e Fix transform constraint trying to transform to shape bounds.
Diffs=
bd9a2e12a Fix transform constraint trying to transform to shape bounds. (#5727)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-08-01 18:44:45 +00:00
79836aea3d chore: release flutter v0.11.9
Diffs=
1192a06b9 chore: release flutter v0.11.9 (#5723)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-08-01 15:53:15 +00:00
01a12255ea basic text test
adding a basic text test to get to the bottom of text not working

Diffs=
66e234066 basic text test (#5718)
b69ae1312 Lift tess decoders into a static lib (#5709)

Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2023-08-01 14:48:05 +00:00
f14627211e chore: end with call to dispose
Fixes: https://github.com/rive-app/rive-flutter/issues/335

By calling `super.dispose()` at the end - as suggested in the Flutter docs for widgets + render objects.

Added the same to the editor (for widgets + render objects)

These changes _should_ not result in any issues. But I don't know if there are valid reasons for any of these to call super.dispose first - if yes, then we should investigate the underlying reason for that.

Diffs=
913760d97 chore: end with call to dispose (#5703)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-08-01 11:52:24 +00:00
bd683637d2 chore: add pubspec topics
See [Pub topics](https://dart.dev/tools/pub/pubspec#topics) and [existing topics](https://pub.dev/topics)

Diffs=
1db023d07 chore: add pubspec topics (#5704)
baefd620c Fix crash when no Follow path target specified (#5706)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-08-01 11:50:30 +00:00
6ce24aa349 Update text render styles when origin changes.
Diffs=
caed30e55 Update text render styles when origin changes. (#5699)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-07-29 03:47:42 +00:00
2f7d8763e7 Text fixes
Bunch of text fixes:
- gradients respect origin on text
- changing font size updates the text editor selection
- apply @avivian's transform constraint fix from https://github.com/rive-app/rive/pull/5689 to cpp

Diffs=
6af562d4c Text fixes (#5696)
fcccdeccd Add originX and originY support to images (#5624)
5b2a52f44 Fix text alignment in cpp based runtimes (#5691)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-07-29 01:49:02 +00:00
8ac04725c9 Replace broken hero image on runtime READMEs
Separate PRs for react + react native

Diffs=
dd6983034 Replace broken hero image on runtime READMEs (#5690)
5034c8612 Build with rive_text from Android Studio (#5681)

Co-authored-by: Zachary Plata <plata.zach@gmail.com>
2023-07-28 15:38:19 +00:00
96627405fa Keep width height in rivs
[Archive.zip](https://github.com/rive-app/rive/files/12175519/Archive.zip)

re-adds the width height stuff, so that we do not remove parameters from files, as the "old" runtimes still need these to layout assets properly

included the same .riv once broken and once "fixed" @luigi-rosso i got a question about this "widthChanged/heightChanged"

Diffs=
a1b1c1ec3 Keep width height in rivs (#5672)
be33bd1b1 update thumbnailer for text (#5667)

Co-authored-by: Luigi Rosso <luigi.rosso@gmail.com>
Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2023-07-26 18:20:16 +00:00
c1c4c94533 Updates for publishing Rive Flutter
Some updates to clean up warnings and info reported from flutter analyze.

Diffs=
83e539cff Updates for publishing Rive Flutter (#5666)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-07-25 23:36:50 +00:00
8dfb05c64d Adding run targeting to text value ranges!
Ability to target an individual run with the modifier range:
<img width="1577" alt="CleanShot 2023-07-24 at 16 25 12@2x" src="https://github.com/rive-app/rive/assets/454182/48bca39b-057c-4ed5-b04e-cada62c1f190">

Diffs=
215d11c86 Adding run targeting to text value ranges! (#5660)

Co-authored-by: Alex Gibson <agibson.uk@gmail.com>
Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-07-25 22:26:38 +00:00
810730f00c Follow path distance support all values & fix scaling issue.
Fixes the following as discussed:
- FP not respecting scale values of constrained component
- FP not handling distance values <0 and >100

This video shows 4 scenarios (all 4 show car being scaled from 100-500% and back):

TL - distance animating from 0 to 200 with orient on
TR - distance animating from 0 to -100 with orient on
BL - distance animating from 0 to 100 with orient on and animating path
BR - distance animating from 0 to 100 with orient off and car rotating 720 degrees

https://github.com/rive-app/rive/assets/186340/15156cec-ac90-4b67-8bfb-b4a60e99090f

Diffs=
24aaadf9a Follow path distance support all values & fix scaling issue. (#5659)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2023-07-25 21:48:13 +00:00
a69627fb3c Runtime clip text
Clippy clip

Diffs=
f49673939 Runtime clip text (#5661)

Co-authored-by: Alex Gibson <agibson.uk@gmail.com>
2023-07-25 08:58:11 +00:00
9e7a831df6 Make TextValueRun visible to clients and NestedArtboards too.
Makes this easier:
```
class MyController extends RiveAnimationController<Artboard> {
  @override
  bool init(Artboard core) {
    var run = core.component<TextValueRun>("blah");
    run?.text = "HEEEEEY";

    return super.init(core);
  }

  @override
  void apply(Artboard? core, double elapsedSeconds) {}
}
```

Also exposes NestedArtboard which lots of users have requested.

Diffs=
fa36ec055 Make TextValueRun visible to clients and NestedArtboards too. (#5657)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-07-24 21:27:49 +00:00
db112aa589 Fix runtime image sizes and run core generator.
Follow this thread: https://2dimensions.slack.com/archives/CLLCU09T6/p1690220943525829

Note that re-running the generator picked up some more changes.

Diffs=
aeb9210ad Fix runtime image sizes and run core generator. (#5655)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-07-24 19:55:58 +00:00
f999112d92 improve Rive widget clipping and sizing
- Exposes `useArtboardSize` in RiveAnimation
- Checks to see if clipping is disabled - Artboard.clip
- Provides means to supply a custom Rect for clipping

Diffs=
fa6ed717b improve Rive widget clipping and sizing (#5154)
13863bf8f Rive Text for iOS and Android! (#5634)
9e0c43b70 Fix small bugs caught by JC (and Alex). (#5647)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-07-24 17:11:14 +00:00
f1a666d9a2 ran generate core runtimes
just ran "generate_core_runtimes.sh" because it looks like we've started to fall behind a bunch here.

Any reason not to get this merged (after sorting any issues)

looks like it has some text updates & follow constraints?
i guess it'd be good to double check this for things we do not want in the public runtimes

Diffs=
d0c65132d ran generate core runtimes (#5628)
420d27a5b FollowPathConstraint to extend TransformSpaceConstraint (#5635)

Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2023-07-21 16:49:33 +00:00
df9191d6fa refactor asset export helpers, moving them into rive-api & moving som…
…e asset extensions into api as well

bit of a refactor...
tldr move stage mutation & export mutation stuff into rive api (we couldjust move export i guess...)
move the export helper into rive-api as well

this allows peon to share the same code as our backend here!

Diffs=
17a07fe2e refactor asset export helpers, moving them into rive-api & moving som… (#5620)

Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2023-07-20 14:42:33 +00:00
b4ec7a7ab4 use the dimensions of the image at runtime, rather than of the ImageA…
…sset

ok just "fixing" how we export .riv files, and no-longer rely on width and height form image assets, but take them from the image instead.

its not "huge" difference, but basically it means that if we replace an existing image with an image of different dimensions we end up drawing the image from the centre of where the original image was, rather than the top left, which is a bit mroe forgiving

example:

got a few images in here, (they're all like 5k x 3k pixels, so all quite large)

<img width="1086" alt="CleanShot 2023-07-03 at 16 28 34@2x" src="https://github.com/rive-app/rive/assets/1216025/625e0d34-ac0c-4eb6-ad75-cb839aca92ac">

before this change this would look like:

<img width="1135" alt="CleanShot 2023-07-03 at 16 28 46@2x" src="https://github.com/rive-app/rive/assets/1216025/8ba848da-5938-4897-a664-eaae39c86806">

with this change we get

<img width="1113" alt="CleanShot 2023-07-03 at 16 29 17@2x" src="https://github.com/rive-app/rive/assets/1216025/c5f30eb6-21bd-419e-802d-9c98c00399e7">

(the mesh is kinda interesting here)

*note* i'm not touching the cpp runtime just yet, so this & other changes still need to make it down there

Diffs=
235908221 use the dimensions of the image at runtime, rather than of the ImageA… (#5519)

Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2023-07-20 13:59:39 +00:00
591b275519 Update http v1.1.0
Resolves https://github.com/rive-app/rive-flutter/issues/321

This requires Sentry to be updated as well.

Diffs=
05c8632e8 Update http v1.1.0 (#5540)
db5688c4a Don't use the '-g' buildoption in premake (#5621)
b17671130 Fixing modifier ranges not updating on the right frame. (#5623)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-07-20 09:51:48 +00:00
d872f57d09 fix: joystick handleSource not enabled for flutter runtime
Fixes https://github.com/rive-app/rive-flutter/issues/331

An inconsistency between the editor and Flutter runtime. External control on a Joystick was not applied.

I used this file to reproduce and test: [joystickdemo2.rev.zip](https://github.com/rive-app/rive/files/12051102/joystickdemo2.rev.zip)

Expected behaviour (the handle is controlled by the position of the top rectangle):

https://github.com/rive-app/rive/assets/13705472/1eae3a71-5f2d-4375-a531-d36b61e5cc61

Diffs=
44f6c4b9c fix: joystick handleSource not enabled for flutter runtime (#5589)
d1f8710f5 Fix dependency order issues for Follow Path (#5595)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-07-19 10:20:47 +00:00