From 6f9c3f170e1c53146a138281fff36f4465f7c5d9 Mon Sep 17 00:00:00 2001 From: William Salmon Date: Mon, 1 Nov 2021 21:42:22 +0000 Subject: [PATCH] Change default to better match the default before this patch set --- druid/src/widget/common.rs | 2 +- druid/src/widget/image.rs | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/druid/src/widget/common.rs b/druid/src/widget/common.rs index dae80cb593..30e326d4f3 100644 --- a/druid/src/widget/common.rs +++ b/druid/src/widget/common.rs @@ -36,7 +36,7 @@ pub enum FillStrat { impl Default for FillStrat { fn default() -> Self { - FillStrat::Contain + FillStrat::ScaleDown } } diff --git a/druid/src/widget/image.rs b/druid/src/widget/image.rs index bed5bc6c5e..2316f762e1 100644 --- a/druid/src/widget/image.rs +++ b/druid/src/widget/image.rs @@ -322,8 +322,9 @@ mod tests { 2, ); - let image_widget = - Image::new(image_data).interpolation_mode(InterpolationMode::NearestNeighbor); + let image_widget = Image::new(image_data) + .interpolation_mode(InterpolationMode::NearestNeighbor) + .fill_mode(FillStrat::Contain); Harness::create_with_render( (), @@ -370,8 +371,9 @@ mod tests { 2, ); - let image_widget = - Image::new(image_data).interpolation_mode(InterpolationMode::NearestNeighbor); + let image_widget = Image::new(image_data) + .interpolation_mode(InterpolationMode::NearestNeighbor) + .fill_mode(FillStrat::Contain); Harness::create_with_render( true,