Skip to content

Commit

Permalink
Cache not updating correctly when Image object is passed. Fixed #98
Browse files Browse the repository at this point in the history
  • Loading branch information
flamendless committed Sep 14, 2021
1 parent edfbfa4 commit cadcb65
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Internal/UI/Image.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,18 @@ function Image.Begin(Id, Options)
local Instance = GetInstance(Id)
local WinItemId = Window.GetItemId(Id)
if Instance.Image == nil then
if Options.Image == nil then
assert(Options.Path ~= nil, "Path to an image is required if no image is set!")
Instance.Image = GetImage(Options.Path)
else
Instance.Image = Options.Image
end
else
if Instance.Image ~= Options.Image then
Instance.Image = Options.Image
end
end
Instance.Image:setWrap(Options.WrapH, Options.WrapV)
Expand Down

0 comments on commit cadcb65

Please sign in to comment.