diff options
Diffstat (limited to 'experimental/tqtinterface/qt4/src/kernel/tqpaintdevice_x11.cpp')
-rw-r--r-- | experimental/tqtinterface/qt4/src/kernel/tqpaintdevice_x11.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/experimental/tqtinterface/qt4/src/kernel/tqpaintdevice_x11.cpp b/experimental/tqtinterface/qt4/src/kernel/tqpaintdevice_x11.cpp index 243260741..fd4cc0b36 100644 --- a/experimental/tqtinterface/qt4/src/kernel/tqpaintdevice_x11.cpp +++ b/experimental/tqtinterface/qt4/src/kernel/tqpaintdevice_x11.cpp @@ -1105,11 +1105,16 @@ static void create_dpis() TQ_CHECK_PTR( dpisX ); TQ_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); } } |