mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-21 21:52:30 +01:00
BUGFIX: Tail window position does not update when being dragged (#1275)
This commit is contained in:
parent
25afecc0ec
commit
9dc3b22919
@ -307,8 +307,15 @@ function LogWindow({ hidden, script, onClose }: LogWindowProps): React.ReactElem
|
||||
if (
|
||||
e instanceof MouseEvent &&
|
||||
(e.clientX < 0 || e.clientY < 0 || e.clientX > innerWidth || e.clientY > innerHeight)
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
if (rootRef.current) {
|
||||
// We can set x,y directly. Calling setPosition will make unnecessary calls of updateDOM and rerender.
|
||||
const currentState = rootRef.current.state as { x: number; y: number };
|
||||
propsRef.current.x = currentState.x;
|
||||
propsRef.current.y = currentState.y;
|
||||
}
|
||||
};
|
||||
|
||||
// Max [width, height]
|
||||
|
Loading…
Reference in New Issue
Block a user