Skip to content

Use new updateCPURenderAttributes in video sensing #2542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/extensions/scratch3_video_sensing/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/unit/extension_video_sensing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down