Correct code for handling flipped view in NSDrawBitmap::::...

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@26306 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
gcasa 2008-03-15 23:37:45 +00:00
parent 483f98475b
commit 9d2eaeb01a
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2008-03-15 19:35-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Source/gsc/GSStreamContext.m: Correct call in NSDrawBitmap::::...
to add NSHeight, not NSWidth to the y coordinate if it's flipped.
2008-03-15 17:48-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Source/gsc/GSStreamContext.m: Added implementation for GSDrawImage.

View file

@ -832,6 +832,7 @@ fpfloat(FILE *stream, float f)
if([image isKindOfClass: [NSBitmapImageRep class]])
{
fprintf(gstream,"%% BeginImage\n");
[image getBitmapDataPlanes: imagePlanes];
[self NSDrawBitmap: rect
: [image pixelsWide]
@ -844,6 +845,7 @@ fpfloat(FILE *stream, float f)
: [image hasAlpha]
: [image colorSpaceName]
: (const unsigned char **)imagePlanes];
fprintf(gstream,"%% EndImage\n");
}
}
@ -900,7 +902,7 @@ static const char *hexdigits = "0123456789abcdef";
fprintf(gstream, "matrix\ncurrentmatrix\n");
y = NSMinY(rect);
if (flipped)
y += NSWidth(rect);
y += NSHeight(rect);
fpfloat(gstream, NSMinX(rect));
fpfloat(gstream, y);
fprintf(gstream, "translate ");