@flighthq/interaction 0.3.0-next.1032.e2b99fc → 0.3.0-next.1162.e90e518
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { captureBitmapFromImageResource, getBitmapPixelChannel } from '@flighthq/bitmap/contract';
|
|
2
2
|
import { inverseMatrixTransformPointXY } from '@flighthq/geometry/contract';
|
|
3
3
|
import { getNodeWorldMatrix } from '@flighthq/node/contract';
|
|
4
|
-
import {
|
|
4
|
+
import { BitmapTextureSourceKind, ImageChannel, ImageTextureSourceKind, SpriteKind } from '@flighthq/types/contract';
|
|
5
5
|
import { hitTestGraphLocalBounds, registerHitTestPrecise } from './hitTests';
|
|
6
6
|
/**
|
|
7
7
|
* Opt-in exact hit provider for bitmaps: the `*Precise` queries then hit a Sprite only where its pixel
|
|
@@ -21,9 +21,9 @@ function hitTestSpriteAlpha(source, x, y, alphaThreshold) {
|
|
|
21
21
|
return -1;
|
|
22
22
|
const sprite = source;
|
|
23
23
|
const texture = sprite.data.texture;
|
|
24
|
-
if (texture === null || texture.
|
|
24
|
+
if (texture === null || texture.dimension !== '2d')
|
|
25
25
|
return 0;
|
|
26
|
-
const image = texture.
|
|
26
|
+
const image = texture.source;
|
|
27
27
|
if (image === null)
|
|
28
28
|
return 0;
|
|
29
29
|
const bitmap = bitmapForImage(image);
|
|
@@ -37,9 +37,9 @@ function hitTestSpriteAlpha(source, x, y, alphaThreshold) {
|
|
|
37
37
|
return getBitmapPixelChannel(bitmap, px, py, ImageChannel.Alpha) >= alphaThreshold ? 0 : -1;
|
|
38
38
|
}
|
|
39
39
|
function bitmapForImage(image) {
|
|
40
|
-
if (image.kind ===
|
|
40
|
+
if (image.kind === BitmapTextureSourceKind)
|
|
41
41
|
return image;
|
|
42
|
-
if (image.kind !==
|
|
42
|
+
if (image.kind !== ImageTextureSourceKind)
|
|
43
43
|
return null;
|
|
44
44
|
const resource = image;
|
|
45
45
|
const cached = bitmapCache.get(resource);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerSpriteHitTest.js","sourceRoot":"","sources":["../src/registerSpriteHitTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClG,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"registerSpriteHitTest.js","sourceRoot":"","sources":["../src/registerSpriteHitTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClG,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAErH,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAE7E;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CAAC,iBAAyB,CAAC;IAC9D,sBAAsB,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC;AACzG,CAAC;AAED,kGAAkG;AAClG,SAAS,kBAAkB,CAAC,MAAe,EAAE,CAAS,EAAE,CAAS,EAAE,cAAsB;IACvF,IAAI,CAAC,uBAAuB,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC,CAAC;IAEtD,MAAM,MAAM,GAAG,MAAgB,CAAC;IAChC,MAA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AAC;IACvD,MAAM,QAAQ,GAAG,KAAc,CAAC;IAChC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACzC,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACxC,IAAI,MAAM,GAAkB,IAAI,CAAC;IACjC,IAAI,CAAC;QACH,MAAM,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC;IACpD,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,GAAG,IAAI,CAAC;IAChB,CAAC;IACD,8EAA8E;IAC9E,IAAI,MAAM,KAAK,IAAI;QAAE,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACvD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,qBAAqB,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAC7C,MAAM,WAAW,GAAG,IAAI,OAAO,EAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/interaction",
|
|
3
|
-
"version": "0.3.0-next.
|
|
3
|
+
"version": "0.3.0-next.1162.e90e518",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/flighthq/flight.git",
|
|
@@ -36,18 +36,18 @@
|
|
|
36
36
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@flighthq/geometry": "0.3.0-next.
|
|
40
|
-
"@flighthq/node": "0.3.0-next.
|
|
41
|
-
"@flighthq/scene2d": "0.3.0-next.
|
|
42
|
-
"@flighthq/log": "0.3.0-next.
|
|
43
|
-
"@flighthq/path": "0.3.0-next.
|
|
44
|
-
"@flighthq/shape": "0.3.0-next.
|
|
45
|
-
"@flighthq/spatial": "0.3.0-next.
|
|
46
|
-
"@flighthq/signals": "0.3.0-next.
|
|
47
|
-
"@flighthq/bitmap": "0.3.0-next.
|
|
48
|
-
"@flighthq/text": "0.3.0-next.
|
|
49
|
-
"@flighthq/textlayout": "0.3.0-next.
|
|
50
|
-
"@flighthq/types": "0.3.0-next.
|
|
39
|
+
"@flighthq/geometry": "0.3.0-next.1162.e90e518",
|
|
40
|
+
"@flighthq/node": "0.3.0-next.1162.e90e518",
|
|
41
|
+
"@flighthq/scene2d": "0.3.0-next.1162.e90e518",
|
|
42
|
+
"@flighthq/log": "0.3.0-next.1162.e90e518",
|
|
43
|
+
"@flighthq/path": "0.3.0-next.1162.e90e518",
|
|
44
|
+
"@flighthq/shape": "0.3.0-next.1162.e90e518",
|
|
45
|
+
"@flighthq/spatial": "0.3.0-next.1162.e90e518",
|
|
46
|
+
"@flighthq/signals": "0.3.0-next.1162.e90e518",
|
|
47
|
+
"@flighthq/bitmap": "0.3.0-next.1162.e90e518",
|
|
48
|
+
"@flighthq/text": "0.3.0-next.1162.e90e518",
|
|
49
|
+
"@flighthq/textlayout": "0.3.0-next.1162.e90e518",
|
|
50
|
+
"@flighthq/types": "0.3.0-next.1162.e90e518"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@flighthq/quadbatch": "*",
|