mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Update ESLint rules (#2342)
This commit is contained in:
parent
56938cf874
commit
e05acd6fd9
15 changed files with 107 additions and 101 deletions
|
@ -2146,35 +2146,31 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
// in this branch, we're inside the commit zone, and no uncommitted
|
||||
// point exists. Thus do nothing (don't add/remove points).
|
||||
}
|
||||
} else if (
|
||||
points.length > 2 &&
|
||||
lastCommittedPoint &&
|
||||
distance2d(
|
||||
scenePointerX - rx,
|
||||
scenePointerY - ry,
|
||||
lastCommittedPoint[0],
|
||||
lastCommittedPoint[1],
|
||||
) < LINE_CONFIRM_THRESHOLD
|
||||
) {
|
||||
document.documentElement.style.cursor = CURSOR_TYPE.POINTER;
|
||||
mutateElement(multiElement, {
|
||||
points: points.slice(0, -1),
|
||||
});
|
||||
} else {
|
||||
// cursor moved inside commit zone, and there's uncommitted point,
|
||||
// thus remove it
|
||||
if (
|
||||
points.length > 2 &&
|
||||
lastCommittedPoint &&
|
||||
distance2d(
|
||||
scenePointerX - rx,
|
||||
scenePointerY - ry,
|
||||
lastCommittedPoint[0],
|
||||
lastCommittedPoint[1],
|
||||
) < LINE_CONFIRM_THRESHOLD
|
||||
) {
|
||||
if (isPathALoop(points)) {
|
||||
document.documentElement.style.cursor = CURSOR_TYPE.POINTER;
|
||||
mutateElement(multiElement, {
|
||||
points: points.slice(0, -1),
|
||||
});
|
||||
} else {
|
||||
if (isPathALoop(points)) {
|
||||
document.documentElement.style.cursor = CURSOR_TYPE.POINTER;
|
||||
}
|
||||
// update last uncommitted point
|
||||
mutateElement(multiElement, {
|
||||
points: [
|
||||
...points.slice(0, -1),
|
||||
[scenePointerX - rx, scenePointerY - ry],
|
||||
],
|
||||
});
|
||||
}
|
||||
// update last uncommitted point
|
||||
mutateElement(multiElement, {
|
||||
points: [
|
||||
...points.slice(0, -1),
|
||||
[scenePointerX - rx, scenePointerY - ry],
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
@ -24,7 +24,7 @@ export const ButtonIconSelect = <T extends Object>({
|
|||
type="radio"
|
||||
name={group}
|
||||
onChange={() => onChange(option.value)}
|
||||
checked={value === option.value ? true : false}
|
||||
checked={value === option.value}
|
||||
/>
|
||||
{option.icon}
|
||||
</label>
|
||||
|
|
|
@ -22,7 +22,7 @@ export const ButtonSelect = <T extends Object>({
|
|||
type="radio"
|
||||
name={group}
|
||||
onChange={() => onChange(option.value)}
|
||||
checked={value === option.value ? true : false}
|
||||
checked={value === option.value}
|
||||
/>
|
||||
{option.text}
|
||||
</label>
|
||||
|
|
|
@ -78,11 +78,9 @@ const Picker = ({
|
|||
colorInput.current?.focus();
|
||||
event.preventDefault();
|
||||
}
|
||||
} else {
|
||||
if (activeElement === colorInput.current) {
|
||||
firstItem.current?.focus();
|
||||
event.preventDefault();
|
||||
}
|
||||
} else if (activeElement === colorInput.current) {
|
||||
firstItem.current?.focus();
|
||||
event.preventDefault();
|
||||
}
|
||||
} else if (
|
||||
event.key === KEYS.ARROW_RIGHT ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue