Gdiplus [1/3] Improve accuracy in calculating height

Michael Karcher wine at mkarcher.dialup.fu-berlin.de
Fri Jun 27 09:46:55 CDT 2008


Am Freitag, den 27.06.2008, 15:27 +0100 schrieb Huw Davies:
> >  static const REAL mm_per_pixel = 25.4;
> > +static const REAL points_per_inch = 1/72;
> >  
> 
> I know there are several definitions of a point, but none are this big!
> 
> points_per_inch should be around 72.

And if this is code is compiled by a C compiler, you get
points_per_pixel=0, as 1 and 72 are integers, so 1/72 is an integer
division that yields zero. This zero *then* gets converted to REAL. You
probably mean points_per_inch = 72 or inches_per_point = 1./72 (note the
decimal dot!)

Regards,
  Michael Karcher




More information about the wine-devel mailing list