@rive-app/canvas-advanced-single 2.44.0 → 2.44.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rive-app/canvas-advanced-single",
3
- "version": "2.44.0",
3
+ "version": "2.44.1",
4
4
  "description": "Rive's lightweight low-level canvas based web api all in one js file.",
5
5
  "main": "canvas_advanced_single.mjs",
6
6
  "homepage": "https://rive.app",
@@ -286,6 +286,14 @@ export declare class RenderPaintWrapper {
286
286
  radialGradient(sx: number, sy: number, ex: number, ey: number): void;
287
287
  addStop(color: number, stop: number): void;
288
288
  completeGradient(): void;
289
+ gradientTransform(
290
+ xx: number,
291
+ xy: number,
292
+ yx: number,
293
+ yy: number,
294
+ tx: number,
295
+ ty: number,
296
+ ): void;
289
297
  }
290
298
 
291
299
  /**
@@ -460,6 +468,11 @@ export declare class File {
460
468
  * @returns Number of view models in the Rive file
461
469
  */
462
470
  viewModelCount(): number;
471
+ /**
472
+ * Reports device pixels per layout point to scripts in this file
473
+ * @param scale - Device pixels per layout point
474
+ */
475
+ displayScale(scale: number): void;
463
476
  /**
464
477
  * Returns a view model by the index in which it is located in the file
465
478
  * @returns ViewModel
@@ -1018,6 +1031,70 @@ export declare class StateMachineInstance {
1018
1031
  * @param y - Y coordinate
1019
1032
  */
1020
1033
  pointerExit(x: number, y: number, id: number): void;
1034
+ /**
1035
+ * Notifies the state machine of indirect scroll input (a mouse wheel, or a trackpad gesture the
1036
+ * platform already classified as a scroll) at the given coordinate in Artboard space. Direct
1037
+ * touch scrolling stays on the pointer path.
1038
+ *
1039
+ * A gesture latches to the scroll view that takes its first event and stays there, even past
1040
+ * that view's edge, until the gesture ends. A gesture with no end phase (a wheel) ends once the
1041
+ * state machine advances 0.1s without another scroll event.
1042
+ *
1043
+ * @param x - X coordinate
1044
+ * @param y - Y coordinate
1045
+ * @param dx - Horizontal distance the content moves, in Artboard pixels. Revealing content to
1046
+ * the right is negative, so a DOM wheel delta must be negated.
1047
+ * @param dy - Vertical distance the content moves, in Artboard pixels. Revealing content below
1048
+ * is negative.
1049
+ * @param phase - Where the event sits within its gesture: 0 begin, 1 update, 2 end,
1050
+ * 3 momentum, 4 inertiaCancel. A phaseless wheel only ever sends 1 (update).
1051
+ * @param precise - True for a pixel-precise source such as a trackpad, false for a detented
1052
+ * wheel.
1053
+ * @param timeStamp - Event time in seconds.
1054
+ * @param id - Pointer id
1055
+ * @returns 0 when nothing took the event, 1 when a scroll view did, 2 when an opaque scroll
1056
+ * view did.
1057
+ */
1058
+ pointerScroll(
1059
+ x: number,
1060
+ y: number,
1061
+ dx: number,
1062
+ dy: number,
1063
+ phase: number,
1064
+ precise: boolean,
1065
+ timeStamp: number,
1066
+ id: number,
1067
+ ): number;
1068
+ /**
1069
+ * Returns true if anything under the given Artboard coordinate would move for this scroll
1070
+ * event, without applying it. Always true while a gesture is latched.
1071
+ * See {@link pointerScroll} for the parameters.
1072
+ */
1073
+ wantsScroll(
1074
+ x: number,
1075
+ y: number,
1076
+ dx: number,
1077
+ dy: number,
1078
+ phase: number,
1079
+ precise: boolean,
1080
+ ): boolean;
1081
+ /**
1082
+ * Returns true if a wheel-enabled scroll view sits under the given Artboard coordinate, even
1083
+ * one that cannot move right now.
1084
+ *
1085
+ * @param x - X coordinate
1086
+ * @param y - Y coordinate
1087
+ */
1088
+ hasScrollTargetAt(x: number, y: number): boolean;
1089
+ /**
1090
+ * Returns true while a scroll gesture is latched to a scroll view in this state machine or a
1091
+ * nested one.
1092
+ */
1093
+ hasScrollLatch(): boolean;
1094
+ /**
1095
+ * Ends any scroll gesture in flight, latch included.
1096
+ */
1097
+ cancelScroll(): void;
1021
1098
 
1022
1099
  /**
1023
1100
  * Returns true if this state machine has any focus nodes registered in its focus tree.