fix:修复快捷键89设置项不出现的问题,调整数据统计写法
This commit is contained in:
parent
b118fbb031
commit
ba3ae07e8d
@ -494,6 +494,22 @@ utils.prototype.deepEqual = function (x, y) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 兼容性的 Set 差集计算
|
||||
* @param {Set} setA
|
||||
* @param {Set} setB
|
||||
* @returns {Set}
|
||||
*/
|
||||
utils.prototype.getSetDifference = function (setA, setB) {
|
||||
// 看起来set.difference并没有被网站polyfill
|
||||
if (typeof setA.difference === 'function') {
|
||||
return setA.difference(setB);
|
||||
}
|
||||
|
||||
return new Set([...setA].filter(item => !setB.has(item)));
|
||||
}
|
||||
|
||||
|
||||
////// 裁剪图片 //////
|
||||
utils.prototype.splitImage = function (image, width, height) {
|
||||
if (typeof image == "string") {
|
||||
|
||||
21716
project/plugins.js
21716
project/plugins.js
File diff suppressed because it is too large
Load Diff
3
runtime.d.ts
vendored
3
runtime.d.ts
vendored
@ -2859,6 +2859,9 @@ interface utils {
|
||||
/** 比较两个变量是否值相等 */
|
||||
deepEqual(x: unknown, y: unknown): boolean
|
||||
|
||||
/** 获取两个set的差集 */
|
||||
getSetDifference(setA:Set, setB:Set):Set
|
||||
|
||||
/**
|
||||
* 等比例切分一张图片
|
||||
* @example core.splitImage(core.material.images.images['npc48.png'], 32, 48); // 把npc48.png切分成若干32×48px的小人
|
||||
|
||||
Loading…
Reference in New Issue
Block a user