mirror of
https://github.com/maaslalani/confetty.git
synced 2024-11-21 23:26:40 +00:00
fix: allow to init with custom width and heigth
This commit is contained in:
parent
6bc31f21b1
commit
8c21d0b660
@ -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{
|
||||
|
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user