add hw2
This commit is contained in:
13
node_modules/@iconify/utils/lib/icon/transformations.js
generated
vendored
Normal file
13
node_modules/@iconify/utils/lib/icon/transformations.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Merge transformations
|
||||
*/
|
||||
function mergeIconTransformations(obj1, obj2) {
|
||||
const result = {};
|
||||
if (!obj1.hFlip !== !obj2.hFlip) result.hFlip = true;
|
||||
if (!obj1.vFlip !== !obj2.vFlip) result.vFlip = true;
|
||||
const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
|
||||
if (rotate) result.rotate = rotate;
|
||||
return result;
|
||||
}
|
||||
|
||||
export { mergeIconTransformations };
|
||||
Reference in New Issue
Block a user