Ensure that a valid DPI is always set

(cherry picked from commit f19aa203c9)
v3.5.13-sru
Timothy Pearson 12 years ago committed by Slávek Banko
parent 5ae82a06c3
commit cbe0a27bbf

@ -529,11 +529,16 @@ static void create_dpis()
Q_CHECK_PTR( dpisX );
Q_CHECK_PTR( dpisY );
for ( i = 0; i < screens; i++ ) {
dpisX[ i ] = (DisplayWidth(dpy,i) * 254 + DisplayWidthMM(dpy,i)*5)
/ (DisplayWidthMM(dpy,i)*10);
dpisY[ i ] = (DisplayHeight(dpy,i) * 254 + DisplayHeightMM(dpy,i)*5)
/ (DisplayHeightMM(dpy,i)*10);
if (DisplayWidthMM(dpy,i) < 1)
dpisX[ i ] = 75; // default the dpi to 75.
else
dpisX[ i ] = (DisplayWidth(dpy,i) * 254 + DisplayWidthMM(dpy,i)*5)
/ (DisplayWidthMM(dpy,i)*10);
if (DisplayHeightMM(dpy,i) < 1)
dpisY[ i ] = 75; // default the dpi to 75.
else
dpisY[ i ] = (DisplayHeight(dpy,i) * 254 + DisplayHeightMM(dpy,i)*5)
/ (DisplayHeightMM(dpy,i)*10);
}
}

Loading…
Cancel
Save