BS
Начать на нем писать и тогда ты поймешь:
без него не могу жить
Size: a a a
BS
SL
elemPathPairs
🦉
combine(elemPathPairs, cursorPosition, (elemPath, cursor) => {})
yv
🦜
BS
🦜
🦉
elemPathPairs
🦉
elemPathPairs
🦜
BS
🦉
export const currentlySelected = combine({ elemPathPairs, cursorPosition }).map(
({ elemPathPairs, cursorPosition }) => {
let result = null;
result = elemPathPairs.find((item: any) => {
const bounds = item.path.getBounds();
if (
bounds.fLeft < cursorPosition.x &&
bounds.fTop < cursorPosition.y &&
bounds.fRight > cursorPosition.x &&
bounds.fBottom > cursorPosition.y
) {
return item.elem;
}
return null;
});
return result;
},
);
elemPathPairs.on(cursorPosition, (pairs, cursor) => {})
🦉
🦉
$elemPathPairs.on($cursorPosition, (elemPathPairs, cursorPosition) => {})
🦉
export const currentlySelected = combine({ elemPathPairs, cursorPosition }).map(
({ elemPathPairs, cursorPosition }) => {
let result = null;
result = elemPathPairs.find((item: any) => {
const bounds = item.path.getBounds();
if (
bounds.fLeft < cursorPosition.x &&
bounds.fTop < cursorPosition.y &&
bounds.fRight > cursorPosition.x &&
bounds.fBottom > cursorPosition.y
) {
return item.elem;
}
return null;
});
return result;
},
);
🦜
DS
VK
export const currentlySelected = combine({ elemPathPairs, cursorPosition }).map(
({ elemPathPairs, cursorPosition }) => {
let result = null;
result = elemPathPairs.find((item: any) => {
const bounds = item.path.getBounds();
if (
bounds.fLeft < cursorPosition.x &&
bounds.fTop < cursorPosition.y &&
bounds.fRight > cursorPosition.x &&
bounds.fBottom > cursorPosition.y
) {
return item.elem;
}
return null;
});
return result;
},
);
BS
🦜