element: Clip to tile size if available instead of element geometry
This commit is contained in:
parent
8f7dc7f00c
commit
e4e7567174
6 changed files with 31 additions and 0 deletions
|
|
@ -358,6 +358,7 @@ impl CosmicWindow {
|
|||
&self,
|
||||
renderer: &mut R,
|
||||
location: Point<i32, Physical>,
|
||||
max_size: Option<Size<i32, Logical>>,
|
||||
output_scale: Scale<f64>,
|
||||
scale: f64,
|
||||
alpha: f32,
|
||||
|
|
@ -411,6 +412,9 @@ impl CosmicWindow {
|
|||
}
|
||||
geo = geo.upscale(scale);
|
||||
geo.loc += location.to_f64().to_logical(output_scale);
|
||||
if let Some(max_size) = max_size {
|
||||
geo.size = geo.size.clamp(Size::default(), max_size.to_f64());
|
||||
}
|
||||
|
||||
let window_key =
|
||||
CosmicMappedKey(CosmicMappedKeyInner::Window(Arc::downgrade(&self.0.0)));
|
||||
|
|
@ -434,6 +438,7 @@ impl CosmicWindow {
|
|||
&self,
|
||||
renderer: &mut R,
|
||||
location: Point<i32, Physical>,
|
||||
max_size: Option<Size<i32, Logical>>,
|
||||
scale: Scale<f64>,
|
||||
alpha: f32,
|
||||
scanout_override: Option<bool>,
|
||||
|
|
@ -490,6 +495,9 @@ impl CosmicWindow {
|
|||
if has_ssd {
|
||||
geo.size.h += SSD_HEIGHT as f64;
|
||||
}
|
||||
if let Some(max_size) = max_size {
|
||||
geo.size = geo.size.clamp(Size::default(), max_size.to_f64());
|
||||
}
|
||||
|
||||
if (has_ssd || clip) && !is_maximized {
|
||||
let window_key =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue