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:
parent
a71d12f07b
commit
a3e690d191
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue