Hi

I decided to find the pesky bug that makes pictures inserted in the
text take up way too much space.

Appears that the problem is that display / layout unit conversion
factors used in fg_GraphicRaster differs from that used in the column
layout code.

The former is 1440 / 72 = 14 (fg_GraphicRaster.cpp:152) and the latter
14.3999999 (fp_Column.cpp:622).

The below patch replaces one hardwired value for another, fixing the
problem. But I must admit that I don't know the source of these magic
values, and I suspect the correct solution would be to replace the
hardwired value with something computed. Would someone care to
enlighten me?

Thanks,
Jesper

Index: fg_GraphicRaster.cpp
===================================================================
RCS file: /cvsroot/abi/src/text/fmt/xp/fg_GraphicRaster.cpp,v
retrieving revision 1.19
diff -u -5 -r1.19 fg_GraphicRaster.cpp
--- fg_GraphicRaster.cpp        2001/04/19 15:32:02     1.19
+++ fg_GraphicRaster.cpp        2001/04/29 08:42:20
@@ -147,11 +147,12 @@
                        double fScale = pG->getResolution() / 100.0;
                        
                        iDisplayWidth = (UT_sint32) (iImageWidth * fScale);
                        iDisplayHeight = (UT_sint32) (iImageHeight * fScale);
 
-                       fScale = 1440.0 / 72.0;
+//                     fScale = 1440.0 / 72.0;
+                       fScale = 14.399999999999999;
                        iLayoutWidth = (UT_sint32) (iImageWidth * fScale);
                        iLayoutHeight = (UT_sint32) (iImageHeight * fScale);
 
                }
        }

Reply via email to