aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Gadola <67549788+giusgad@users.noreply.github.com>2023-02-18 21:16:50 +0100
committerGitHub <noreply@github.com>2023-02-18 21:16:50 +0100
commit2cfa814213527aa1b45db3955794a159286705cd (patch)
tree728874bacdf5edfad0fac1a0768da3e22a770ada
parentfix: fixed pets not disappearing when killed while paused (diff)
parentfix @@@ (diff)
fix: spaces overflow - merge pull request #13 from matthewsia98/@@@
-rw-r--r--lua/pets/animations.lua11
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