Skip to content

Commit

Permalink
fix: should storage the scale when scale init
Browse files Browse the repository at this point in the history
  • Loading branch information
Decodetalkers committed Oct 6, 2024
1 parent 6335861 commit e1dbaf4
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions layershellev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1675,20 +1675,16 @@ impl<T> Dispatch<wp_fractional_scale_v1::WpFractionalScaleV1, ()> for WindowStat
_qhandle: &QueueHandle<Self>,
) {
if let wp_fractional_scale_v1::Event::PreferredScale { scale } = event {
let Some(id) = state
.units
.iter()
.find(|info| {
info.fractional_scale
.as_ref()
.is_some_and(|fractional_scale| fractional_scale == proxy)
})
.map(|unit| unit.id)
else {
let Some(unit) = state.units.iter_mut().find(|info| {
info.fractional_scale
.as_ref()
.is_some_and(|fractional_scale| fractional_scale == proxy)
}) else {
return;
};
unit.scale = scale;
state.message.push((
Some(id),
Some(unit.id),
DispatchMessageInner::PreferredScale {
scale_u32: scale,
scale_float: scale as f64 / 120.,
Expand Down

0 comments on commit e1dbaf4

Please sign in to comment.