Fix moving frameable
This commit is contained in:
parent
57db78f645
commit
bb27a8cda0
1 changed files with 10 additions and 0 deletions
|
@ -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()?;
|
||||
|
|
Loading…
Reference in a new issue