From 8c21d0b660587335271c5e6d849d6291c88e1a1c Mon Sep 17 00:00:00 2001 From: Carlos A Becker Date: Mon, 1 Nov 2021 16:30:42 -0300 Subject: [PATCH] fix: allow to init with custom width and heigth --- confetti/confetti.go | 3 +++ fireworks/fireworks.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/confetti/confetti.go b/confetti/confetti.go index b3aee21..faf3a9a 100644 --- a/confetti/confetti.go +++ b/confetti/confetti.go @@ -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{ diff --git a/fireworks/fireworks.go b/fireworks/fireworks.go index 715731c..3824221 100644 --- a/fireworks/fireworks.go +++ b/fireworks/fireworks.go @@ -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{