rig-play 1.2.0 → 1.3.0
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/README.md +2 -4
- package/dist/CanvasRenderer.d.ts +16 -1
- package/dist/CanvasRenderer.d.ts.map +1 -1
- package/dist/DomRenderer.d.ts.map +1 -1
- package/dist/index.js +49 -29
- package/dist/index.js.map +1 -1
- package/dist/pixelRatio.d.ts +22 -0
- package/dist/pixelRatio.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one forced layout both renderers share: how many device pixels one of
|
|
3
|
+
* the root's CSS pixels covers on screen, read off a throwaway box.
|
|
4
|
+
*
|
|
5
|
+
* A renderer rasters at `world × pixelRatio` in the root's own coordinates,
|
|
6
|
+
* so a `transform: scale(z)` on an ancestor — how a pan/zoom stage is built —
|
|
7
|
+
* oversamples by 1/z² in backing pixels unless the zoom is folded into the
|
|
8
|
+
* ratio. Neither renderer measures this on its own: it is a layout read, and
|
|
9
|
+
* there is no per-frame layout read anywhere in this library. The caller
|
|
10
|
+
* invokes `syncPixelRatio()` when a zoom or a resize settles.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Measures `root`'s effective on-screen scale once and returns the ratio now
|
|
14
|
+
* in effect: `devicePixelRatio × scale` when that differs from `current` by
|
|
15
|
+
* more than the deadband, else `current` unchanged. A root that is not laid
|
|
16
|
+
* out (a `display: none` ancestor, a detached root) measures nothing, so
|
|
17
|
+
* nothing is decided and `current` comes back. Appends a hidden box to the
|
|
18
|
+
* root, reads its rect, removes it — the root's children are the same
|
|
19
|
+
* elements in the same order on both sides of the call.
|
|
20
|
+
*/
|
|
21
|
+
export declare function syncedPixelRatio(root: HTMLElement, current: number): number;
|
|
22
|
+
//# sourceMappingURL=pixelRatio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pixelRatio.d.ts","sourceRoot":"","sources":["../src/pixelRatio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAcH;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CA2B3E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rig-play",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Plays skeleton.model.json written by rigc build as plain DOM elements — rigid slots as <img> posed by CSS matrix, deform meshes on small per-part canvases — or as one canvas.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|