mirror of
https://codeberg.org/waydeer/layer-shika.git
synced 2025-11-06 12:04:23 +00:00
refactor: minor changes
This commit is contained in:
parent
11f17a4fc1
commit
bf43337a30
1 changed files with 3 additions and 4 deletions
|
|
@ -25,7 +25,7 @@ use std::rc::{Rc, Weak};
|
||||||
use std::result::Result as StdResult;
|
use std::result::Result as StdResult;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
enum PopupCommand {
|
pub enum PopupCommand {
|
||||||
Show(PopupRequest),
|
Show(PopupRequest),
|
||||||
Close(PopupHandle),
|
Close(PopupHandle),
|
||||||
Resize { key: usize, width: f32, height: f32 },
|
Resize { key: usize, width: f32, height: f32 },
|
||||||
|
|
@ -254,9 +254,8 @@ impl RuntimeState<'_> {
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let current_size = request.size.dimensions();
|
let current_size = request.size.dimensions();
|
||||||
let size_changed = current_size.map_or(true, |(w, h)| {
|
let size_changed =
|
||||||
(w - width).abs() > 0.01 || (h - height).abs() > 0.01
|
current_size.is_none_or(|(w, h)| (w - width).abs() > 0.01 || (h - height).abs() > 0.01);
|
||||||
});
|
|
||||||
|
|
||||||
let needs_repositioning = request.mode.center_x() || request.mode.center_y();
|
let needs_repositioning = request.mode.center_x() || request.mode.center_y();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue