From 9bed114e4873658048fd94d90b5c960489f677d5 Mon Sep 17 00:00:00 2001 From: apple502j <33279053+apple502j@users.noreply.github.com> Date: Sat, 1 Aug 2020 00:09:53 +0900 Subject: [PATCH] Use new updateCPURenderAttributes in video sensing --- src/extensions/scratch3_video_sensing/library.js | 3 +-- test/unit/extension_video_sensing.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/extensions/scratch3_video_sensing/library.js b/src/extensions/scratch3_video_sensing/library.js index 5a6ac344e..6de242142 100644 --- a/src/extensions/scratch3_video_sensing/library.js +++ b/src/extensions/scratch3_video_sensing/library.js @@ -291,8 +291,7 @@ class VideoMotion { // 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(); + drawable.updateCPURenderAttributes(); // Restrict the region the amount and direction are built from to // the area of the current frame overlapped by the given drawable's diff --git a/test/unit/extension_video_sensing.js b/test/unit/extension_video_sensing.js index 197c06e87..22c2adae8 100644 --- a/test/unit/extension_video_sensing.js +++ b/test/unit/extension_video_sensing.js @@ -87,7 +87,7 @@ const isNearAngle = (actual, expect, optMargin = 10) => ( // A fake scratch-render drawable that will be used by VideoMotion to restrain // the area considered for motion detection in VideoMotion.getLocalMotion const fakeDrawable = { - updateMatrix () {}, // no-op, since isTouching always returns true + updateCPURenderAttributes () {}, // no-op, since isTouching always returns true getFastBounds () { return {