diff --git a/src/guihandler/gui/framable.rs b/src/guihandler/gui/framable.rs index 00355d4..6a5e02f 100644 --- a/src/guihandler/gui/framable.rs +++ b/src/guihandler/gui/framable.rs @@ -433,8 +433,18 @@ impl Framable { pub fn change_position_unscaled(&self, x: i32, y: i32) -> Result<()> { assert!(self.is_framed(), "framable needs to be framed first!"); + let left = self.left.load(SeqCst); + let top = self.top.load(SeqCst); + let bottom = self.bottom.load(SeqCst); + let right = self.right.load(SeqCst); + + let width = right - left; + let height = bottom - top; + self.left.store(x, SeqCst); self.top.store(y, SeqCst); + self.right.store(x + width, SeqCst); + self.bottom.store(y + height, SeqCst); for (_, callback) in self.resize_callbacks.read().unwrap().iter() { callback()?;