Merge pull request #2905 from psychon/imagebox_raw_pointers
imagebox:set_widget(): Handle userdata again
This commit is contained in:
commit
bafe028a05
|
@ -133,6 +133,13 @@ end
|
||||||
function imagebox:set_image(image)
|
function imagebox:set_image(image)
|
||||||
local setup_succeed
|
local setup_succeed
|
||||||
|
|
||||||
|
if type(image) == "userdata" then
|
||||||
|
-- This function is not documented to handle userdata objects, but
|
||||||
|
-- historically it did, and it did by just assuming they refer to a
|
||||||
|
-- cairo surface.
|
||||||
|
image = surface.load(image)
|
||||||
|
end
|
||||||
|
|
||||||
if type(image) == "string" then
|
if type(image) == "string" then
|
||||||
-- try to load rsvg handle from file
|
-- try to load rsvg handle from file
|
||||||
setup_succeed = load_and_apply(self, image, load_rsvg_handle, set_handle)
|
setup_succeed = load_and_apply(self, image, load_rsvg_handle, set_handle)
|
||||||
|
|
Loading…
Reference in New Issue