Merge pull request #1076 from danielyxie/dev

Fix log box dragging.
This commit is contained in:
hydroflame 2021-08-21 02:39:17 -04:00 committed by GitHub
commit 480d47eece
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 6 deletions

File diff suppressed because one or more lines are too long

@ -119,7 +119,7 @@ function Industry(params={}) {
};
this.name = params.name ? params.name : 0;
this.type = params.type ? params.type : 0;
this.type = params.type ? params.type : Industries.Agriculture;
this.sciResearch = new Material({name: "Scientific Research"});
this.researched = {}; // Object of acquired Research. Keys = research name

@ -55,12 +55,11 @@ function ScriptLogPopup(props: IProps): React.ReactElement {
function drag(event: React.MouseEvent<HTMLElement, MouseEvent>): void {
event.preventDefault();
//console.log(props.container.clientWidth);
//console.log(props.container.clientHeight);
let x = event.clientX;
let y = event.clientY;
console.log(props.container.clientWidth);
let left = props.container.offsetLeft+props.container.clientWidth/2;
let top = props.container.offsetTop+props.container.clientHeight/2;
let top = props.container.offsetTop+props.container.clientWidth/5;
function mouseMove(event: MouseEvent): void {
left+=event.clientX-x;
top+=event.clientY-y;