diff options
author | Darrell Anderson <[email protected]> | 2012-12-19 14:03:09 -0600 |
---|---|---|
committer | Darrell Anderson <[email protected]> | 2012-12-19 14:03:09 -0600 |
commit | 35202ed0d899a9ff3c77dad72b501fb30e4dcf93 (patch) | |
tree | 683787f69d937483b860973ce17f0c5d430a142d /src/kernel/qpaintdevice_x11.cpp | |
parent | 8d5add0e87ad913bdf0362a83f431995115f3bfa (diff) | |
parent | f19aa203c934d0f85862fdf810a87fe7c5777d17 (diff) | |
download | qt3-35202ed0d899a9ff3c77dad72b501fb30e4dcf93.tar.gz qt3-35202ed0d899a9ff3c77dad72b501fb30e4dcf93.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/qt3
Diffstat (limited to 'src/kernel/qpaintdevice_x11.cpp')
-rw-r--r-- | src/kernel/qpaintdevice_x11.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/kernel/qpaintdevice_x11.cpp b/src/kernel/qpaintdevice_x11.cpp index a755c01..5941657 100644 --- a/src/kernel/qpaintdevice_x11.cpp +++ b/src/kernel/qpaintdevice_x11.cpp @@ -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); } } |