imagebox: Redraw in :set_image()

If someone modifies a cairo surface and then sets the resulting object as the
image of an imagebox, the imagebox needs to redraw. Thus, since surfaces are
modifiable, we cannot assume that nothing changed when the same image is set
multiple times on an imagebox.

However, the dimensions of a surface cannot be changed and thus this does not
need to emit widget::layout_changed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2015-09-27 16:48:54 +02:00 committed by Daniel Hahler
parent a71d12f07b
commit a3e690d191
1 changed files with 2 additions and 0 deletions

View File

@ -96,6 +96,8 @@ function imagebox:set_image(image)
end
if self._image == image then
-- The image could have been modified, so better redraw
self:emit_signal("widget::redraw_needed")
return
end