fix: Refactor useMode hook to fix line positioning bug
This commit is contained in:
parent
a3cd1606db
commit
9ef112e04d
@ -457,10 +457,10 @@ export function useMode() {
|
|||||||
if (historyLines.current[i].direction === 'top') {
|
if (historyLines.current[i].direction === 'top') {
|
||||||
if (prev.direction !== 'right') {
|
if (prev.direction !== 'right') {
|
||||||
newOuterlines.push({
|
newOuterlines.push({
|
||||||
x1: historyLines.current[i].x1 + 50,
|
x1: historyLines.current[i].x1 - 50,
|
||||||
y1: historyLines.current[i].y1 - 50,
|
y1: historyLines.current[i].y1 + 50,
|
||||||
x2: historyLines.current[i].x2 + 50,
|
x2: historyLines.current[i].x2 - 50,
|
||||||
y2: historyLines.current[i].y2 + 50,
|
y2: historyLines.current[i].y2 - 50,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
newOuterlines.push({
|
newOuterlines.push({
|
||||||
@ -499,10 +499,10 @@ export function useMode() {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
newOuterlines.push({
|
newOuterlines.push({
|
||||||
x1: historyLines.current[i].x1 + 50,
|
x1: historyLines.current[i].x1 - 50,
|
||||||
y1: historyLines.current[i].y1 - 50,
|
y1: historyLines.current[i].y1 + 50,
|
||||||
x2: historyLines.current[i].x2 + 50,
|
x2: historyLines.current[i].x2 - 50,
|
||||||
y2: historyLines.current[i].y2 - 50,
|
y2: historyLines.current[i].y2 + 50,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -545,16 +545,16 @@ export function useMode() {
|
|||||||
if (prev?.direction !== 'top') {
|
if (prev?.direction !== 'top') {
|
||||||
newOuterlines.push({
|
newOuterlines.push({
|
||||||
x1: historyLines.current[i].x1 + 50,
|
x1: historyLines.current[i].x1 + 50,
|
||||||
y1: historyLines.current[i].y1 - 50,
|
y1: historyLines.current[i].y1 + 50,
|
||||||
x2: historyLines.current[i].x2 - 50,
|
x2: historyLines.current[i].x2 - 50,
|
||||||
y2: historyLines.current[i].y2 - 50,
|
y2: historyLines.current[i].y2 + 50,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
newOuterlines.push({
|
newOuterlines.push({
|
||||||
x1: historyLines.current[i].x1 + 50,
|
x1: historyLines.current[i].x1 - 50,
|
||||||
y1: historyLines.current[i].y1 - 50,
|
y1: historyLines.current[i].y1 + 50,
|
||||||
x2: historyLines.current[i].x2 + 50,
|
x2: historyLines.current[i].x2 - 50,
|
||||||
y2: historyLines.current[i].y2 - 50,
|
y2: historyLines.current[i].y2 + 50,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user