decord/source/297_createSquare.js
2026-08-04 21:03:28 +00:00

21 lines
535 B
JavaScript

// Module ID: 297
// Function ID: 298
// Name: createSquare
// Dependencies: []
// Module 297 (createSquare)
arg5.createSquare = function createSquare(bottom) {
return { bottom, left: bottom, right: bottom, top: bottom };
};
arg5.normalizeRect = function normalizeRect(hitSlop) {
let tmp = hitSlop;
if (typeof hitSlop === "number") {
const obj = { bottom: null, left: null, right: null, top: null };
obj[0] = hitSlop;
obj[1] = hitSlop;
obj[2] = hitSlop;
obj[3] = hitSlop;
tmp = obj;
}
return tmp;
};