mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 13:10:52 +00:00
* Source/NSBitmapImageRep.m: Reduce floating-point error in the
expression which computes image point size using DPI and pixel size (for TIFF images.) git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33293 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
00e106040c
commit
af6f2c29bc
2 changed files with 10 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
2011-06-13 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/NSBitmapImageRep.m: Reduce floating-point error in the
|
||||
expression which computes image point size using DPI and pixel size
|
||||
(for TIFF images.)
|
||||
|
||||
2011-06-13 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/NSImageRep.m (-description): Implement -description to
|
||||
|
|
|
@ -1915,10 +1915,11 @@ _set_bit_value(unsigned char *base, long msb_off, int bit_width,
|
|||
[_properties setObject: [NSNumber numberWithFloat: _comp_factor]
|
||||
forKey: NSImageCompressionFactor];
|
||||
|
||||
if (info->xdpi > 0 && info->ydpi > 0)
|
||||
if (info->xdpi > 0 && info->xdpi != 72 &&
|
||||
info->ydpi > 0 && info->ydpi != 72)
|
||||
{
|
||||
NSSize pointSize = NSMakeSize((info->width / info->xdpi) * 72.0,
|
||||
(info->height / info->ydpi) * 72.0);
|
||||
NSSize pointSize = NSMakeSize((double)info->width * (72.0 / (double)info->xdpi),
|
||||
(double)info->height * (72.0 / (double)info->ydpi));
|
||||
[self setSize: pointSize];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue