drawable: Use get_object_mut() instead of set_state()
For the same reason as this was just done for buttons.
@@ -66,7 +66,7 @@ impl <'lua> Drawable<'lua> {
/// Sets the geometry, and allocates a new surface.
pub fn set_geometry(&mut self, geometry: Geometry) -> rlua::Result<()> {
use rlua::Error::RuntimeError;
- let mut drawable = self.state()?;
+ let mut drawable = self.get_object_mut()?;
let size_changed = drawable.geo != geometry;
drawable.geo = geometry;
if size_changed {
@@ -81,14 +81,14 @@ impl <'lua> Drawable<'lua> {
// TODO emity property::surface
}
}
- self.set_state(drawable)
+ Ok(())
}
/// Signals that the drawable's surface was updated.
pub fn refresh(&mut self) -> rlua::Result<()> {
- let mut drawable = self.state()?;
+ let mut drawable = self.get_object_mut()?;
drawable.refreshed = true;
- self.set_state(drawable)
+ Ok(())
}
}
