diff options
| author | Matthew Sia <matthewsia98@gmail.com> | 2023-02-18 14:41:52 -0500 |
|---|---|---|
| committer | Matthew Sia <matthewsia98@gmail.com> | 2023-02-18 14:41:52 -0500 |
| commit | 66635bfe840d6d924eab61ef18de7edcbf47eecb (patch) | |
| tree | 728874bacdf5edfad0fac1a0768da3e22a770ada /lua | |
| parent | fix: fixed pets not disappearing when killed while paused (diff) | |
fix @@@
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/pets/animations.lua | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lua/pets/animations.lua b/lua/pets/animations.lua index 3324b61..d8749c7 100644 --- a/lua/pets/animations.lua +++ b/lua/pets/animations.lua @@ -6,13 +6,6 @@ M.Animation.__index = M.Animation -- lines to insert in the buffer to avoid image stretching local lines = {} -local string = "" -for _ = 0, 200 do - string = string .. " " -end -for _ = 0, 20 do - table.insert(lines, string) -end local listdir = require("pets.utils").listdir local sleeping_animations = { "idle", "sit", "liedown" } @@ -37,6 +30,10 @@ function M.Animation.new(sourcedir, type, style, popup, user_opts, state) instance.popup = popup instance.state = state + for _ = 1, instance.popup._.layout.size.height do + table.insert(lines, " ") + end + -- user options instance.row, instance.col = user_opts.row, user_opts.col instance.speed_multiplier = user_opts.speed_multiplier |