341 Commits

Author SHA1 Message Date
40fa8c40e3 Layout updates for flutter runtime
Diffs=
aca47ee5d Layout updates for flutter runtime (#7429)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-06-18 03:19:38 +00:00
fc13a2063e Fix missing API in runtime mounted artboard
Fixing errors caused by merging this PR: https://github.com/rive-app/rive/pull/7310

Diffs=
e103006c8 Fix missing API in runtime mounted artboard (#7403)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-06-11 05:47:11 +00:00
42665e4933 Nested linear animations report events up to parent artboards
Previously, only nested state machines could report events so that listeners in parent artboards could listen for them. This PR adds event reporting for nested simple animations. Had to refactor some stuff to genericize in order for both state machines and linear animations to have similar functionality.

I'm not sure if its possible, or desirable, for nested remap animations to have the same functionality, but that is not included in this PR.

Diffs=
097b68f56 Nested linear animations report events up to parent artboards (#7310)
34e186b32 more renames for harfbuzz (#7398)
b88272290 mark shape as dirty after flagged as target (#7396)
a10b1e61e don’t defer updates when a shape/path is used for hit detect (#7392)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-06-11 04:13:33 +00:00
bf94e7d6b1 feat: Flutter get component predicate
Diffs=
9abd6ee16 feat: Flutter get component predicate (#7388)
8486c3445 Get rid of MetricsPath. (#7371)

Co-authored-by: Anurag Devanapally <anurag.devanapally@aofl.com>
Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-06-07 11:52:32 +00:00
094b050352 chore: release futter 0.13.6
Diffs=
e192d691d chore: release futter 0.13.6 (#7377)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-06-06 23:28:12 +00:00
dc12cfcd46 Fix editor only in AbsoluteLayoutComponent and gen core runtimes
Diffs=
538fc70f2 Fix editor only in AbsoluteLayoutComponent and gen core runtimes (#7339)
dde676085 Fix libjpg on Mac Sonoma (#7329)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-06-01 01:10:56 +00:00
24a492fc12 Setup Image as Sizable for use with layouts
Adding hooks to have images resizable by layouts. As discussed with @alxgibsn for now we'll just stretch to fit. We may want to add fit options in the future.

https://github.com/rive-app/rive/assets/186340/50905b6a-b21e-4bba-84e0-b8418fb149a0

Diffs=
085c0cce6 Setup Image as Sizable for use with layouts (#7338)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-05-31 21:35:31 +00:00
ec3564f1a5 Flutter Runtime API for Nested Inputs
https://github.com/rive-app/rive/assets/186340/00b71832-1293-45fa-b3da-f9abcaa34eb7

Diffs=
c8a151ebb Flutter Runtime API for Nested Inputs (#7325)
e0a786c90 Runtime API for Nested Inputs (#7316)
01d20e026 Use unique_ptr in import stack. (#7307)
5ad13845d Fail early with bad blend modes. (#7302)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-05-30 23:52:11 +00:00
c136a25801 Xxxx fix extra frame rendering
this PR fixes two sources of neverending renders.
the first commit addresses a scenario where, once the stage is zoomed in or out, it gets into a continuous scheduling of frames that prevent the cache from being rebuilt because the debounce resets the previous one. It is fixed by storing a pending zoom value, and only resetting the debounce if the pending value is different than the new zoom value.

The second commit fixes a scenario where, when time remapped animations are advanced in preview mode, it also triggers the advancement of the nested artboards belonging to the remapped artboards.

Diffs=
7474216b4 Xxxx fix extra frame rendering (#7301)

Co-authored-by: hernan <hernan@rive.app>
2024-05-23 20:22:13 +00:00
04d3908f57 Flutter release 0.13.5
Tested out the latest rive-common that now uses `package:web` and `dart:js_interop`

The `RiveFile.initializeText` and everything associated with it are deprecated. Instead, use `RiveFile.initialize`, which will always need to be called when initializing text, audio, and layout.

Calling it `initializeText` is confusing to users as they may not be using text, but still need to call this manually when using RiveFile.import.

There is maybe additional cleanup we could do here, but at least want to make sure the public API is not confusing.

Diffs=
fa7c55934 Flutter release 0.13.5 (#7305)
973ff2276 Fix warnings about invalid toolsets (#7300)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-05-23 19:22:06 +00:00
a0e22e4250 Flutter Wasm Compatibility
Getting the editor and Flutter runtime compatible with Flutter Wasm

https://docs.flutter.dev/platform-integration/web/wasm

Diffs=
0b1834a1a Flutter Wasm Compatibility (#7283)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-05-22 22:28:45 +00:00
23f0ac6d07 fix for unexpected triggered events
fixes #7226
This PR fixes reports of events when animations are playing backward.
It considers both the timeline speed and the state machine state speed to determine direction.
It also handles not reporting an event twice if it comes from a "ping pong" loop.
It also adds a small performance improvement, skipping the binary search if possible.

Diffs=
265c00985 fix for unexpected triggered events (#7227)
8a538c243 validating core objects property keys on load (#7298)
cd6210f42 Make ContourMeasure more robust (#7294)
405b8ef90 use world bounds for coarse grained collision test (#7287)
3734d9bac initialize seed with chrono (#7285)
45b998e68 Simple libjpeg (#7277)

Co-authored-by: hernan <hernan@rive.app>
2024-05-22 21:42:12 +00:00
2a20c3092b Improvements to wrap in layout
Fix a couple of small issues with Wrap in Layout functionality

Diffs=
67ed7133f Improvements to wrap in layout (#7279)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-05-16 03:00:13 +00:00
62148fc963 Layout Editor UX Updates
Layout UX stuff @alxgibsn and I have been working on.

- Layout Padding Inspector (padding)
- Layout Children Inspector (flex direction, gap)
- New points/percent toggle
- Right click component > Wrap in Layout
- Fix text incorrect sizing issue when using intrinsic sizing
- Groups as layout children don't resize to parent layout
- Layout cells in hierarchy
- Add compensate logic when dropping components into layouts
- Bug fixes related to selecting and transforming components and their parent layouts together

<img width="1138" alt="Screenshot 2024-05-13 at 1 31 04 PM" src="https://github.com/rive-app/rive/assets/186340/5df89f3d-44dc-4155-b9e0-09f31b2ea7af">

Diffs=
e89250c39 Layout Editor UX Updates (#7260)
5ccc21fa3 fix advancing nested animations (#7246)
8700c7365 remove harfbuzz flag (#7233)
e0c4d9a20 Don't defer path update if Shape has a dependent skin (#7231)
806ae1fae Fix an assert in contour_measure.cpp (#7232)
7d03c3faf Add strokes, gradients, and blend modes to path_fuzz (#7230)
4342a3f04 Wasm fallback and min safari version (#7214)

Co-authored-by: Alex Gibson <agibson.uk@gmail.com>
Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-05-15 17:41:37 +00:00
d9e9d9ef07 Make NestedArtboard Sizable
Have NestedArtboards implement Sizable so they can be sized by layout components.

Diffs=
51556c678 Make NestedArtboard Sizable (#7179)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-05-02 14:38:46 +00:00
04a5ae3b63 Xxxx support target align from position
A lot of files changed, but they're mostly boilerplate code and changes to the API of the actions.
This PR adds support for using Align Target without moving the aligned target to the pointer position.
Instead, it moves the element from its starting point following the mouse position.
It adds a new boolean property to enable the feature.
In order to achieve this, it's necessary to provide to all actions the current position and the previous position so the action can calculate the delta.

Diffs=
a55f1ffb6 Xxxx support target align from position (#7154)
7d0125c92 Handle NaN in PLS paths and transforms (#7176)
3f7a8f75c fix: text init race condition (#7174)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
Co-authored-by: hernan <hernan@rive.app>
2024-05-01 23:44:44 +00:00
d36d83bbdd Flutter fix ticker mode
This PR brings in a community fix: https://github.com/rive-app/rive-flutter/pull/380

This was working previously. I don't know what changed to cause this to break. Either way, having these conditional checks is sensible. This PR adds golden test with various ticker mode states to ensure this does not regress again.

Diffs=
78c081bce Flutter fix ticker mode (#7182)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
Co-authored-by: Paweł Polański <jaggernod@gmail.com>
2024-05-01 20:11:02 +00:00
c947d3cd6f Fit and alignment for nested artboards
Adds fit and alignment properties for nested artboards. This will make nested artboards work better with layouts, in particular with the resizeArtboard fit type which allows resizing a nested artboard's runtime artboard rather than scaling it. I've hidden this feature behind the layouts flag.

https://github.com/rive-app/rive/assets/186340/fcdecc67-83ee-446a-814d-607ba1137958

Diffs=
ee45b994f Fit and alignment for nested artboards (#7147)
e96739328 GameKit on Windows (#7150)
1c7e61b8a fix follow path not working with path as target and shape with 0 opacity (#7156)
328d307df initialize audio manager only if an instance needs it (#7132)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-04-30 22:12:28 +00:00
3ed23894d0 update flutter runtime
updated the flutter runtime
@alxgibsn @philter This update included some changes from other branches.
Can you verify that all looks good?

Diffs=
cd9520371 update flutter runtime (#7141)
2b2e92ca7 Fix audio instances (#7113)

Co-authored-by: hernan <hernan@rive.app>
2024-04-25 22:40:21 +00:00
3208fae4bf chore: release flutter v0.13.2
Pubspec is already updated updated to the correct version, but we've not pushed to Pub yet (probably a mistake).
- Changelog is updated with latest changes
- This PR just fixes some analyzer warnings and is a bit of a formality to make it clear we are releasing to pub

Diffs=
fdd52090d chore: release flutter v0.13.2 (#7100)
89053041a add out of band audio support ios - abstracted audio! (#7079)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-04-22 16:28:58 +00:00
4e2547d08d Expose methods to easily get Rive state machine inputs
Our current API is quite verbose and requires casting to the relevant class types when using the current find API. These methods simplify the process.

Diffs=
1460f5366 Expose methods to easily get Rive state machine inputs (#7085)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-04-22 10:11:46 +00:00
06265422cc feat!: add audio out-of-band
We'll need to decide on the Enum case for getting the `Type`. Long term it might be better to just not have this to avoid breaking changes.

If we decide to remove that, or how it is currently in the PR with the extended conditions, it's a breaking change.

The changes to `LocalAssetLoader` aren't breaking though, I realise now.

I also removed deprecated things.

Diffs=
1a8b3c7cc feat!: add audio out-of-band (#7037)
99d28e1ac Xxxx randomization updates part 2 (#7097)
a0004fa72 Xxxx support random transitions (#7094)
edac19b06 support randomizing transitions (#7082)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-04-20 07:12:54 +00:00
e34fc4cc41 feat: adds play and pause to artboard
An oversight from our side. We've previously recommended setting `isActive` to false on the StateMachine or Animation. But this will not propagate down to nested artboards.

Diffs=
e64daefff feat: adds play and pause to artboard (#7078)
2828b7b01 propagate volume to nested artboards (#7067)
4a9947630 Stop audio in iOS when backgrounded. (#7055)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-04-19 09:34:59 +00:00
a22fc5f047 Ensure rive_common wasm module gets pulled into rive_flutter properly
In rive_flutter, we were doing a check to see if the file had any text before we loaded the rive_common wasm module. However, since all rive_common deps (text, audio, layout) are bundled together, we need to make sure to check for existence of those as well, and since Artboard extends LayoutComponent, we pretty much always need to load the module.

Diffs=
024f95b10 Ensure rive_common wasm module gets pulled into rive_flutter properly (#7040)
cb2ea5b2d Exposing artboard volume (#7022)
8ecc99130 Fixing audio runtimes. (#7007)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-04-11 18:23:47 +00:00
4ede8c868e Fix WASM audio MP3
Increases the stack size to accommodate for the greedy MP3 decoder.

Discussion here: https://2dimensions.slack.com/archives/CLLCU09T6/p1712597103737719

Diffs=
cf43d9fdf Fix WASM audio MP3 (#6995)
0bc446fad negative speed fix (#6982)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2024-04-09 03:35:03 +00:00
2acceb195b Audio asset volume + VU
This also fixes a bug where multiple sounds would play at the same time making clipping even worse...

Some more details here:

https://2dimensions.slack.com/archives/CHMAP278R/p1712443028936919

Diffs=
f832e2617 Audio asset volume + VU (#6985)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2024-04-07 15:14:48 +00:00
b440934299 Fix audio overlap
Also fixes some warnings from the flutter runtime.

Diffs=
5d10f615b Fix audio overlap (#6979)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2024-04-05 21:34:08 +00:00
3da1cbe3a1 Getting audio working in Flutter runtime.
@philter this also adds a bunch of layout stuff to the Flutter runtime as I had to run the core generator, does it all look ok?

Diffs=
6837ee0f7 Getting audio working in Flutter runtime. (#6975)
522a31bc2 treat cubic curve as quad when control point equals endpoint (#6919)
473dbcb5c Export proxy and testing at runtime. (#6950)
a69bfba11 Export audio clip (#6949)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2024-04-03 22:26:25 +00:00
584d00fa00 propagate parent input change to nested input
We have decided to add a new attribute to our code generator that will allow to overwrite the behavior of property setters for the c++ runtime.
For the editor, the solution is more complex because we still need to reflect the nested artboard value in the inspector so users can follow changes both at the parent and the child level.

Diffs=
fee67f16d propagate parent input change to nested input (#6878)
ff2c0cbf6 apply final update if it has not been applied before (#6930)
f3739347c Get wasm sizes back down. (#6927)
a0a40213f No simd canvas (#6926)
e2328daeb More LTO tweaks (#6904)
cae08a3c5 Add a @rive-app/webgl2 package that uses PLS (#6845)

Co-authored-by: hernan <hernan@rive.app>
2024-03-28 00:09:58 +00:00
b53ddd7cd6 support for interrupting transitions on state change
We are adding a flag to support interrupting transitions on state changes.

Diffs=
337f9df1c support for interrupting transitions on state change (#6850)

Co-authored-by: hernan <hernan@rive.app>
2024-03-15 19:26:13 +00:00
8487b7f3d7 Add an object generator.
I guess I never PRed this...

Adds ability to override built-in objects to custom ones so you can do things like add shadows:
```
RiveAnimation.asset(
  'assets/shadowtext.riv',
  objectGenerator: (coreTypeKey) {
    switch (coreTypeKey) {
      case ShapeBase.typeKey:
        return ShadowRiveShape();
    }
    return null;
  },
```

![image](https://github.com/rive-app/rive/assets/454182/cae261b1-8005-4c49-9714-3bb1dca50cde)

```
class ShadowRiveShape extends Shape {
  Paint? _shadowPaint;
  @override
  void onAdded() {
    if (name == 'ShadowShape') {
      // This was named "ShadowShape" we use that as a simple way to determine
      // that we want to add a drop shadow at runtime.
      _shadowPaint = Paint()
        ..imageFilter = ImageFilter.blur(
          // Make it a 10x10 black blur
          sigmaX: 10,
          sigmaY: 10,
          tileMode: TileMode.clamp,
        );
    }
    super.onAdded();
  }

  @override
  K? clone<K extends Core<CoreContext>>() {
    var shape = ShadowRiveShape();
    shape.copy(this);
    return shape as K;
  }

  @override
  void draw(Canvas canvas) {
    var shadow = _shadowPaint;
    if (shadow != null) {
      // We draw a blurred version of this shape before regular drawing. Make
      // sure to respect clipping rules for the shadow too.
      bool clipped = clip(canvas);
      var path = pathComposer.fillPath;
      canvas.save();
      if (!fillInWorld) {
        canvas.transform(worldTransform.mat4);
      }
      // Offset the shadow to the bottom right (change to whatever you want).
      canvas.translate(10, 10);
      canvas.drawPath(path, shadow);

      canvas.restore();

      if (clipped) {
        canvas.restore();
      }
    }

    // Draw the regular shape.
    super.draw(canvas);
  }
}
```

Diffs=
99a2215da Add an object generator. (#6805)
7cb7eb812 Upgrade rive_wasm to the new premake system (#6789)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2024-03-08 20:02:05 +00:00
f3ec042a47 Run core generators
Need to get these in before we publish rive_flutter.

Diffs=
8785b0ff7 Run core generators (#6761)
e62a93370 fix text not updating when style changes (#6743)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
Co-authored-by: hernan <hernan@rive.app>
2024-03-07 16:27:26 +00:00
8e7c5dae92 Remove taffy
Removing Taffy. Will be replacing with Yoga shortly.

Diffs=
12cf6b8c3 Remove taffy (#6670)
f2ecb3a22 Implement an MSAA fallback for PLS (#6680)
ffde4f5f6 trigger change when text modifier updates (#6675)
20b585bea add support for text feature in runtime (#6674)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-03-01 22:45:42 +00:00
870234fddc sort hit shapes when draw order changes and stop propagation on hit s…
sort hit shapes when draw order changes and stop propagation on hit success

Diffs=
8bca56dca sort hit shapes when draw order changes and stop propagation on hit s… (#6624)
9d605a1fe Updating harfbuzz to 8.3.0 (#6652)
5cb42a9b0 Unity compute bounds (#6649)
b765280df Fix path for downstream runtime. (#6645)
1cf6a65f1 Fix downstream cpp tests (#6643)
a35883508 Single test script for windows and mac. (#6642)
37ce9aaea Fix tests to use harfbuzz renames. (#6641)
9338d6ec6 make a change to force a mono flush (#6638)
6059f744d update mono to keep details in commit and not pr (#6637)
a394393a0 update mono scripts to be able to create "fixing" pr (#6636)

Co-authored-by: hernan <hernan@rive.app>
2024-02-21 14:40:02 +00:00
5ee2d85279 Fix incorrect default layout flags value
Added tests for default values on the layoutFlags. When I removed the clip bit, I generated the wrong hex value as the default which this fixes. This should not impact customers since there is no way currently to modify layoutFlags in the editor (since we moved clip out).

Also fixes a copy/paste error.

Diffs=
5e834adc2 Fix incorrect default layout flags value (#6596)
2277c08fc Apply same changes as downstream (#6634)
faf6ea317 Option to build harfbuzz with renames to avoid static lib collision. (#6630)
c51bda03e Fix downstream windows tests. (#6632)
34fff8ea4 Audio out of band in Unity! (#6616)
61f553d6d Audio for Unity (#6606)
562fc5c51 fix cast (#6599)
e145f9348 Add audio preview generator. (#6580)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-02-16 04:59:43 +00:00
cb2fe94eba Move clip property outside of layoutFlags
Moved clip property out of layoutFlags0 into it's own bool value, and right shifted layoutFlags0 by 1 bit.

Diffs=
cd4a8f840 Move clip property outside of layoutFlags (#6579)
27ac9fcbb text modifier length calculation fix (#6494)

Co-authored-by: Luigi Rosso <luigi.rosso@gmail.com>
Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-02-07 21:00:50 +00:00
3c3362e70a Update key to align with old artboard clip value
Diffs=
c053d6acc Update key to align with old artboard clip value (#6574)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-02-06 23:34:05 +00:00
cc80e0b888 support draw order sorting
add support for sorting draw orders

Diffs=
fd1dcaab8 support draw order sorting (#6554)
f5e458f80 Rework text/event count/at. (#6548)
852b17bca fix ./build_viewer.sh run (#6545)
029d67465 Update goldens (#6542)

Co-authored-by: hernan <hernan@rive.app>
2024-02-03 01:38:24 +00:00
9f55101ec5 apply current state update before changing states
Once a transition completes, we update the state without applying the advance to the currentState of the transition.
This PR checks whether a transition is complete to invoke apply to the complete state before moving to the next state.
Note: It could happen that the next state is actually the same one completed in the transition, so apply would be called twice on the same state.
Conceptually it makes sense to treat it as two different things, since one is in the context of the transition and the other "apply" is in the context of the new state. But in terms of performance, this might not be the best solution.

Diffs=
da14cc814 apply current state update before changing states (#6538)
ac0d97c12 Clean up emscripten build (#6531)

Co-authored-by: hernan <hernan@rive.app>
2024-02-01 05:16:13 +00:00
c978da30da make sure we force embedded assets when exporting for cloud renderer …
…preview

fixes an issue when hosted/referenced is set for assets for the cloud renderer.

by either producing a zip file or a file without the assets (both of which do not work well when previewing the render)

removed a few things that were flagged up as warnings as well.

i ignored an extra dependency for editor though:
```
  just_audio: ^0.9.36
```

gonna have a quick look if i can add a test...

Diffs=
acdaee21f make sure we force embedded assets when exporting for cloud renderer … (#6536)
353cf349b Fix GL rendering with URP. (#6535)
6150f1267 Unity with new Premake scripts! (#6532)
231b35a41 Unity Android & C# style updates (#6517)
da8d2d5f7 fix listener resolving to different event (#6528)
026caa5a9 Tests use new premake system (#6526)
a8c86e949 fix viewer build (#6527)

Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2024-01-31 18:21:43 +00:00
7bfa7e5646 Layout constraints
A lot here and some of it isn't fully complete but want to try to get this merged so Alex can have an easier time iterating on the UX.

What's done:
- Build integration of Taffy Rust library with Flutter via Rustup & Cargokit (more info here: https://matejknopp.com/post/flutter_plugin_in_rust_with_no_prebuilt_binaries/)
- Flex & Grid functionality implemented in Flutter (editor & Flutter runtime) with placeholder editor UX
- Flex implemented in Wasm
- Editor layout UX flagged

To do:
- Grid implementation in Wasm needs more work, but can come after this PR since it won't be part of Alex's initial editor UX.
- Flex & Grid in CPP is done for the most part, but isn't part of this PR. It can't be merged until we get Taffy to build. @dragostis did some work on the build stuff here https://github.com/rive-app/rive/pull/6385 but will likely need additional work.

This PR revs rive_common on pub.dev to 0.2.9 and flutter_wasm on npm to 16.0.0

Diffs=
5ca57bcf5 Layout constraints (#6421)
584a1c28e fix elastic interpolator crash with period 0 (#6450)
af2f2d632 Unify storage buffers for atomic mode and normal (#6449)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
Co-authored-by: Luigi Rosso <luigi.rosso@gmail.com>
Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-01-17 20:29:59 +00:00
40cf82f877 fix: validate attached state before handling pointer events
Fixes https://github.com/rive-app/rive-flutter/issues/355

Diffs=
cfe49a60b fix: validate attached state before handling pointer events (#6439)
dcbe806b0 default to skia branch for commit hash in cache helper (#6432)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-01-11 16:52:40 +00:00
031dcb6813 Remove threshold adjustment for exit time.
This is to address the issue discussed here re: missing final events: https://2dimensions.slack.com/archives/CLLCU09T6/p1704819997769059

We added a small amount of padding to the exit time check to fix this issue: https://github.com/rive-app/rive/issues/4997

This is causing us to miss reporting events that are right on the last frame.

It seems like we also addressed the issue above by being more precise with the "should exit" logic from a linear animation instance. I can no longer repro the issue Pedro posted in the original bug (where it would never exit the Jump animation) above without the exit time padding.
https://github.com/rive-app/rive/pull/5939

Diffs=
21b318244 Remove threshold adjustment for exit time. (#6427)
d67aeac4d Implement re-ordering for PLS atomic draws (#6417)
a3788ed8a add support for self clipping shape (#6416)
b58df4ba7 clone metrics path when a path is added (#6394)
124a8f4e2 Defer PLS writes to GPU resources until flush (#6405)
d52d14a1f Refactor PLSRenderer into draw objects (#6397)
8666bde87 Convert RenderPath/CommandPath and RenderPaint to refcounted objects (#6395)
9c3da38e3 Delete the Vec2D default constructor (#6388)
ee0a1ee5d use skia directly from skia repository for recorder (#6359)
f8004f31e add support for svg export (#6166)
d563202b4 fix off color interpolation (#6375)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2024-01-10 03:29:43 +00:00
07c6d25de0 feat: flutter hit test self on rive render object
This PR adds hit testing to Flutter by overriding `hitTestSelf` on the Rive RenderObject.

Currently, the hit area is the entire bounding box of the canvas. This means that when a Rive animation is rendered above any other Flutter content (for example, a Stack) all hits are absorbed by Rive and do not pass through.

With this change, Rive will only absorb hits if the pointer comes in contact with a hittable Rive element.

With this change, `handleEvent` will only be called if `hitTestSelf` returns true. There is some duplicate work here as `_processEvent` already performs similar hit test logic, which we can look at optimizing. But `hitTest` needed to be separate method call, as `hitTestSelf` is called before `handleEvent` and `handleEvent` sends additional information (whether it's a pointer down/up etc.).

Diffs=
95beaa4f5 feat: add flutter hit test self on rive render object (#6341)
bd71143bc chore: fix broken docs link (#6360)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-12-18 09:00:21 +00:00
3b03b0565e update flutter runtime
Diffs=
423366fb7 update flutter runtime (#6350)
0f08dd379 prevent pointer event propagation to collapsed nested artboards (#6322)
d863a6258 mark text dirty when the style id of a text run changes (#6334)
c357e7aa7 Add a "lite_rtti" utility and use it with Render objects (#6311)
53972cc17 Make tess compile again (#6308)
fabb7f97f Ios out of band (#6232)
ed4474d1a skip constraints in editor when target is collapsed (#6294)

Co-authored-by: hernan <hernan@rive.app>
2023-12-13 15:26:11 +00:00
412ee93224 ignore paths that are inactive in solos when calculating hit test
we were not skipping collapsed shapes and paths for hit testing, so pointer events were triggering on elements that were inactive.
This PR skips those paths to fix it.
Note: there might be some performance improvements that can be done in the future skipping shapes that are fully hidden, but this PR most likely covers the majority of the usual cases.

Diffs=
2c2d332e0 ignore paths that are inactive in solos when calculating hit test (#6276)
c37a28468 generate drawing rules in the correct order (#6275)

Co-authored-by: hernan <hernan@rive.app>
2023-11-23 12:40:13 +00:00
a04ede704e Xxxx hidden paths runtime render fixes solos
This PR adds support for soloing individual paths and nested shapes. It also aligns editor and runtime behavior.

Diffs=
ee674a819 Xxxx hidden paths runtime render fixes solos (#6252)
a0f076e31 tendon crash fix (#6258)
fdad66136 Disable d3d blend state during PLS flush (#6254)
e717ed98a add clipResult enum and render clips to copy the editor behavior (#6218)
faba3ff51 Unity (#6173)
18ae32102 Delete assets after artboards to fix race condition with FileAssetReferencers. (#6223)
252100f48 Fix validation for listeners to validate with nested inputs (#6220)
f21ebc98c compute parameters when cubic values change (#6207)

Co-authored-by: hernan <hernan@rive.app>
2023-11-22 20:18:16 +00:00
bee29187dd Fix event listening for RuntimeArtboard
Flutter runtime needed an additional callback hooked up to listen for nested artboard events because its main artboard is a RuntimeArtboard.

Diffs=
c5f85ed7f Fix event listening for RuntimeArtboard (#6202)
5e33d8c96 fix: Made default and copy constructors explicit. (#6203)

Co-authored-by: Gordon Hayes <pggordonhayes@gmail.com>
Co-authored-by: Philip Chung <philterdesign@gmail.com>
2023-11-06 10:27:38 +00:00
73731ffa6e Fix follow path 6070
fixes #6070

thank you @philter for sorting out the path mess, i got myself extra confused with `addToRawPath` (i thought we were simply passing the variables along and one of them got corrupted, i didnt notice that it was just down to a bad static cast when we were a path!)

vid of this behaving in dart & cpp

Added a rive-flutter test to this.

one interesting thing, essentially follow path currently follows the "first" path in a shape.

https://github.com/rive-app/rive/assets/1216025/d59026f6-c901-439c-aff2-2214a021ee75

Diffs=
ef8a4e7f7 Fix follow path 6070 (#6182)
3927ea695 add support for rendering static scene (#6192)

Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
Co-authored-by: Phil Chung <philterdesign@gmail.com>
2023-11-03 17:15:23 +00:00
357b9ed102 Core.copy doesn't copy core object id.
Usually when we copy/clone an object we do it with the intention of adding to core shortly after. This has a problem if the object has an id already, it won't be assigned a new one which means we'll end up with multiple objects in core with the same id. This breaks the fundamental concept in Core that each Id will always point to an object of a specific type (which is important for undo/redo but also for concurrent client changes). Changing a type should incur a new core object.

Note that reference ids to other objects still get copied.

Diffs=
f9a356004 Core.copy doesn't copy core object id. (#6187)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-11-01 20:52:01 +00:00