mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-08 04:25:23 +00:00
All images are always resized by nearest if possible/needed
This commit is contained in:
parent
269f3880d7
commit
4e17db2f04
@ -19,12 +19,15 @@ impl Image {
|
|||||||
let image = if dynamic_image.height() > height
|
let image = if dynamic_image.height() > height
|
||||||
|| dynamic_image.width() > width
|
|| dynamic_image.width() > width
|
||||||
{
|
{
|
||||||
if dynamic_image.height() <= height*2 && dynamic_image.width() <= width*2 {
|
if dynamic_image.height() <= height * 2
|
||||||
|
&& dynamic_image.width() <= width * 2
|
||||||
|
{
|
||||||
dynamic_image.resize(width, height, FILTER)
|
dynamic_image.resize(width, height, FILTER)
|
||||||
}else{
|
} else {
|
||||||
dynamic_image.resize(width*2, height*2, FilterType::Nearest).resize(width, height, FILTER)
|
dynamic_image
|
||||||
|
.resize(width * 2, height * 2, FilterType::Nearest)
|
||||||
|
.resize(width, height, FILTER)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
dynamic_image
|
dynamic_image
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user