fix: allow to init with custom width and heigth

This commit is contained in:
Carlos A Becker 2021-11-01 16:30:42 -03:00 committed by Maas Lalani
parent 6bc31f21b1
commit 8c21d0b660
2 changed files with 6 additions and 0 deletions

View File

@ -64,7 +64,10 @@ func InitialModel() model {
if err != nil {
panic(err)
}
return InitialModelWithSize(width, height)
}
func InitialModelWithSize(width, height int) model {
return model{system: &simulation.System{
Particles: Spawn(width, height),
Frame: simulation.Frame{

View File

@ -65,7 +65,10 @@ func InitialModel() model {
if err != nil {
panic(err)
}
return InitialModelWithSize(width, height)
}
func InitialModelWithSize(width, height int) model {
return model{system: &simulation.System{
Particles: Spawn(width, height),
Frame: simulation.Frame{