forge
Explore
Log in

Don't you dare go Hollow

Move workspace options check to workspace tests

Browse files at this commit

37aea69715a61cb08fa3612a3f2e65d01df161f5Ivan MolodetskikhParent: 7024a23
src/layout/mod.rsmodified+0 -14
@@ -2561,13 +2561,6 @@ impl<W: LayoutElement> Layout<W> {
2561 "workspace base options must be synchronized with layout"2561 "workspace base options must be synchronized with layout"
2562 );2562 );
2563 2563
2564- let options = Options::clone(&workspace.base_options)
2565- .adjusted_for_scale(workspace.scale().fractional_scale());
2566- assert_eq!(
2567- &*workspace.options, &options,
2568- "workspace options must be base options adjusted for workspace scale"
2569- );
2570-
2571 assert!(2564 assert!(
2572 seen_workspace_id.insert(workspace.id()),2565 seen_workspace_id.insert(workspace.id()),
2573 "workspace id must be unique"2566 "workspace id must be unique"
@@ -2725,13 +2718,6 @@ impl<W: LayoutElement> Layout<W> {
2725 "workspace options must be synchronized with layout"2718 "workspace options must be synchronized with layout"
2726 );2719 );
2727 2720
2728- let options = Options::clone(&workspace.base_options)
2729- .adjusted_for_scale(workspace.scale().fractional_scale());
2730- assert_eq!(
2731- &*workspace.options, &options,
2732- "workspace options must be base options adjusted for workspace scale"
2733- );
2734-
2735 assert!(2721 assert!(
2736 seen_workspace_id.insert(workspace.id()),2722 seen_workspace_id.insert(workspace.id()),
2737 "workspace id must be unique"2723 "workspace id must be unique"
src/layout/workspace.rsmodified+6 -0
@@ -1787,6 +1787,12 @@ impl<W: LayoutElement> Workspace<W> {
1787 assert!(scale > 0.);1787 assert!(scale > 0.);
1788 assert!(scale.is_finite());1788 assert!(scale.is_finite());
1789 1789
1790+ let options = Options::clone(&self.base_options).adjusted_for_scale(scale);
1791+ assert_eq!(
1792+ &*self.options, &options,
1793+ "options must be base options adjusted for scale"
1794+ );
1795+
1790 assert!(self.view_size.w > 0.);1796 assert!(self.view_size.w > 0.);
1791 assert!(self.view_size.h > 0.);1797 assert!(self.view_size.h > 0.);
1792 1798