mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Merge pull request #2293 from paulkaplan/fix-video-motion-matrix
Fix video sensing error with stale matrices
This commit is contained in:
commit
5a556dd671
2 changed files with 7 additions and 0 deletions
|
@ -289,6 +289,11 @@ class VideoMotion {
|
||||||
_curr: curr
|
_curr: curr
|
||||||
} = this;
|
} = this;
|
||||||
|
|
||||||
|
// The public APIs for Renderer#isTouching manage keeping the matrix and
|
||||||
|
// silhouette up-to-date, which is needed for drawable#isTouching to work (used below)
|
||||||
|
drawable.updateMatrix();
|
||||||
|
if (drawable.skin) drawable.skin.updateSilhouette();
|
||||||
|
|
||||||
// Restrict the region the amount and direction are built from to
|
// Restrict the region the amount and direction are built from to
|
||||||
// the area of the current frame overlapped by the given drawable's
|
// the area of the current frame overlapped by the given drawable's
|
||||||
// bounding box.
|
// bounding box.
|
||||||
|
|
|
@ -87,6 +87,8 @@ const isNearAngle = (actual, expect, optMargin = 10) => (
|
||||||
// A fake scratch-render drawable that will be used by VideoMotion to restrain
|
// A fake scratch-render drawable that will be used by VideoMotion to restrain
|
||||||
// the area considered for motion detection in VideoMotion.getLocalMotion
|
// the area considered for motion detection in VideoMotion.getLocalMotion
|
||||||
const fakeDrawable = {
|
const fakeDrawable = {
|
||||||
|
updateMatrix () {}, // no-op, since isTouching always returns true
|
||||||
|
|
||||||
getFastBounds () {
|
getFastBounds () {
|
||||||
return {
|
return {
|
||||||
left: -120,
|
left: -120,
|
||||||
|
|
Loading…
Reference in a new issue