aboutsummaryrefslogtreecommitdiff
path: root/scale.c
diff options
context:
space:
mode:
Diffstat (limited to 'scale.c')
-rw-r--r--scale.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/scale.c b/scale.c
index 79432db..f9270ff 100644
--- a/scale.c
+++ b/scale.c
@@ -835,7 +835,8 @@ static void scale_select_scaler(unsigned w, unsigned h, size_t pitch) {
dst_w = SCREEN_WIDTH;
dst_h = SCREEN_HEIGHT;
dst_offs = 0;
- } else if (scale_size == SCALE_SIZE_ASPECT) {
+ } else if (scale_size == SCALE_SIZE_ASPECT ||
+ (scale_size == SCALE_SIZE_NONE && w > SCREEN_WIDTH || h > SCREEN_HEIGHT)) {
dst_w = SCREEN_WIDTH;
dst_h = SCREEN_WIDTH / aspect_ratio + 0.5;
dst_offs = ((SCREEN_HEIGHT-dst_h)/2) * SCREEN_PITCH;
@@ -845,7 +846,7 @@ static void scale_select_scaler(unsigned w, unsigned h, size_t pitch) {
dst_h = SCREEN_HEIGHT;
dst_offs = ((SCREEN_WIDTH-dst_w)/2);
}
- } else if (scale_size == SCALE_SIZE_NONE && w <= SCREEN_WIDTH && h <= SCREEN_HEIGHT) {
+ } else if (scale_size == SCALE_SIZE_NONE) {
unsigned dst_x = ((SCREEN_WIDTH - w) * SCREEN_BPP / 2);
unsigned dst_y = ((SCREEN_HEIGHT - h) / 2);
dst_offs = dst_y * SCREEN_PITCH + dst_x;