Skip to content

Commit de118fd

Browse files
llyyrDudemanguy
authored andcommitted
m_option: don't allow m_geometry_apply to make a coordinate 0
Same reasoning as the previous commit.
1 parent 9214b44 commit de118fd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

options/m_option.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2305,9 +2305,9 @@ void m_geometry_apply(int *xpos, int *ypos, int *widw, int *widh,
23052305
// keep aspect if the other value is not set
23062306
double asp = (double)prew / preh;
23072307
if (gm->w > 0 && !(gm->h > 0)) {
2308-
*widh = *widw / asp;
2308+
*widh = MPMAX(*widw / asp, 1);
23092309
} else if (!(gm->w > 0) && gm->h > 0) {
2310-
*widw = *widh * asp;
2310+
*widw = MPMAX(*widh * asp, 1);
23112311
}
23122312
if (center) {
23132313
*xpos += prew / 2 - *widw / 2;

0 commit comments

Comments
 (0)