Willem Rein Oudshoorn <[EMAIL PROTECTED]> writes:
>
> Thanks. I have found the problem, also there is a quick fix but
> it might not be the correct fix.
[text skipped]
> Now the quick fix is to modify setSize in NSImage to round the size
> downwards to the nearest integer.
> This is a reasonable fix if we assume that Bitmaps will not/are not
> subject to the coordinate transformations from Postscript --> Device coordinates.
Sorry to followup on my own post.
After reading some documentation I have come to the conclusion that this is
NOT a correct fix. The correct fix will involve modifying the
-_compositeGState:fromRect:toPoint:op:fraction:
method and or friends.
However, I do not like changing these methods just a few days
before a release.
So I suggest that we do the rounding in setSize for this release.
I sincerly hope however that Nicola or someone else looks at it.
But I can not image this making the situation worse than it is.
It will only have an effect when a non-integer size of an image
is specified. And I think that this only happens when images
are resize. This should not impact the normal gui refreshing and
redrawing.
2002-01-28 Willem Rein Oudshoorn <[EMAIL PROTECTED]>
* gui/Source/NSImage.m ([NSImage -initWithSize:]): round the size down
([NSImage -setSize:]): round the size down
Index: Source/NSImage.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/gui/Source/NSImage.m,v
retrieving revision 1.62
diff -c -r1.62 NSImage.m
*** Source/NSImage.m 17 Dec 2001 16:51:50 -0000 1.62
--- Source/NSImage.m 28 Jan 2002 21:20:49 -0000
***************
*** 289,295 ****
//_flags.flipDraw = NO;
if (aSize.width && aSize.height)
{
! _size = aSize;
_flags.sizeWasExplicitlySet = YES;
}
//_flags.usesEPSOnResolutionMismatch = NO;
--- 289,300 ----
//_flags.flipDraw = NO;
if (aSize.width && aSize.height)
{
! // FIXME: rounding down is just a quick fix.
! // the non-integrality of the image should be
! // taken care of in the composite methods in
! // the backend.
! _size.width = (int) aSize.width;
! _size.height = (int) aSize.height;
_flags.sizeWasExplicitlySet = YES;
}
//_flags.usesEPSOnResolutionMismatch = NO;
***************
*** 488,494 ****
--- 493,506 ----
- (void) setSize: (NSSize)aSize
{
+ // FIXME: the rounding down is just a quick fix
+ // it should actually be handled in composite in
+ // the backend.
+ _size.width = (int) aSize.width;
+ _size.height = (int) aSize.height;
_size = aSize;
+
_flags.sizeWasExplicitlySet = YES;
// TODO: This invalidates any cached data
}