Fix resizing state bug

master
Joshua Sigona 3 years ago
parent 911ba668a4
commit e487851f92
  1. 20
      src/skilltree/skillTreeEditor.js

@ -65,18 +65,20 @@ function SkillTreeEditor(p) {
for (var x=0;x<skillLines[y].length;x++) { for (var x=0;x<skillLines[y].length;x++) {
var padX = x!==0?gridPaddingX*x:0 var padX = x!==0?gridPaddingX*x:0
var padY = y!==0?gridPaddingY*y:0 var padY = y!==0?gridPaddingY*y:0
controls.push(<SkillTreeSelector GetData={p.GetData} cl={Number(cl)} defaultValue={skillLines[y][x]} callback={(char,x,y)=>{ if (y<dimensionY&&x<dimensionX) {
var string = [...skillLines] controls.push(<SkillTreeSelector GetData={p.GetData} cl={Number(cl)} defaultValue={skillLines[y][x]} callback={(char,x,y)=>{
var stringLine = string[y].split('') var string = [...skillLines]
stringLine[x] = char var stringLine = string[y].split('')
string[y] = stringLine.join('') stringLine[x] = char
setSkillLines(string) string[y] = stringLine.join('')
} setSkillLines(string)
} ADJUSTMENT={ADJUSTMENT} x={x} y={y} gridSizeX={gridSizeX} gridSizeY={gridSizeY} padX={padX} padY={padY}/>) }
} ADJUSTMENT={ADJUSTMENT} x={x} y={y} gridSizeX={gridSizeX} gridSizeY={gridSizeY} padX={padX} padY={padY}/>)
}
} }
} }
setRenderedInputs(controls) setRenderedInputs(controls)
},[skillLines,gridSizeX,gridSizeY,gridPaddingX,gridPaddingY,cl]) },[skillLines,gridSizeX,gridSizeY,gridPaddingX,gridPaddingY,cl,dimensionY,dimensionX])
return <> return <>
<label for="classSelect">Class Select:</label><select id="classSelect" value={cl} onChange={(f)=>{setCl(f.currentTarget.value)}}> <label for="classSelect">Class Select:</label><select id="classSelect" value={cl} onChange={(f)=>{setCl(f.currentTarget.value)}}>

Loading…
Cancel
Save