GUI2/Canvas: default to NN scaling for images if not specified

This commit is contained in:
Charles Dang 2022-08-20 20:53:22 -04:00
parent a5b154088c
commit ca366554a0

View File

@ -376,11 +376,19 @@ image_shape::resize_mode image_shape::get_resize_mode(const std::string& resize_
return resize_mode::stretch;
} else if(resize_mode == "scale_sharp") {
return resize_mode::scale_sharp;
} else if(resize_mode == "scale") {
return resize_mode::scale;
} else {
if(!resize_mode.empty() && resize_mode != "scale") {
if(!resize_mode.empty()) {
ERR_GUI_E << "Invalid resize mode '" << resize_mode << "' falling back to 'scale'.";
}
return resize_mode::scale;
// Linear scaling just looks horrible as a default, especially on HDPI screens, and even
// for some non-pixel art (the logo, for example). Nearest-neighbor isn't perfect for those
// usecases, but it's definitely better, in my opinion.
//
// -- vultraz, 2022-08-20
return resize_mode::scale_sharp;
}
}