Corrected affine transform struct element names and added some drawing functions.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18288 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2003-12-30 12:42:37 +00:00
parent e8c1d1f693
commit 4f10989eb8
6 changed files with 26 additions and 25 deletions

View file

@ -37,8 +37,8 @@ typedef struct {
float m12;
float m21;
float m22;
float tx;
float ty;
float tX;
float tY;
} NSAffineTransformStruct;
@interface NSAffineTransform : NSObject <NSCopying, NSCoding>

View file

@ -333,7 +333,7 @@ void NSEraseRect(NSRect aRect)
{
NSGraphicsContext *ctxt = GSCurrentContext();
DPSgsave(ctxt);
DPSsetgray(ctxt, 1.0);
DPSsetgray(ctxt, NSWhite);
NSRectFill(aRect);
DPSgrestore(ctxt);
}
@ -456,7 +456,7 @@ void NSDottedFrameRect(const NSRect aRect)
float dot_dash[] = {1.0, 1.0};
NSGraphicsContext *ctxt = GSCurrentContext();
DPSsetgray(ctxt, 0.0);
DPSsetgray(ctxt, NSBlack);
DPSsetlinewidth(ctxt, 1.0);
// FIXME
DPSsetdash(ctxt, dot_dash, 2, 0.0);
@ -673,11 +673,15 @@ NSDrawWhiteBezel(const NSRect aRect, const NSRect clipRect)
void
NSDrawDarkBezel(NSRect aRect, NSRect clipRect)
{
// FIXME
NSDrawGrayBezel(aRect, clipRect);
}
void
NSDrawLightBezel(NSRect aRect, NSRect clipRect)
{
// FIXME
NSDrawWhiteBezel(aRect, clipRect);
}
void
@ -715,7 +719,8 @@ NSDrawFramePhoto(const NSRect aRect, const NSRect clipRect)
void
NSDrawWindowBackground(NSRect aRect)
{
// TODO
[[NSColor windowBackgroundColor] set];
NSRectFill(aRect);
}
void

View file

@ -40,8 +40,8 @@
#define B matrix.m12
#define C matrix.m21
#define D matrix.m22
#define TX matrix.tx
#define TY matrix.ty
#define TX matrix.tX
#define TY matrix.tY
/* A Postscript matrix look like this:
@ -100,8 +100,8 @@ static NSAffineTransformStruct identityTransform = {
m[1] = matrix.m12;
m[2] = matrix.m21;
m[3] = matrix.m22;
m[4] = matrix.tx;
m[5] = matrix.ty;
m[4] = matrix.tX;
m[5] = matrix.tY;
PSconcat(m);
}
@ -515,8 +515,8 @@ static NSAffineTransformStruct identityTransform = {
matrix.m12 = replace[1];
matrix.m21 = replace[2];
matrix.m22 = replace[3];
matrix.tx = replace[4];
matrix.ty = replace[5];
matrix.tX = replace[4];
matrix.tY = replace[5];
}
- (void) getMatrix: (float[6])replace
@ -525,8 +525,8 @@ static NSAffineTransformStruct identityTransform = {
replace[1] = matrix.m12;
replace[2] = matrix.m21;
replace[3] = matrix.m22;
replace[4] = matrix.tx;
replace[5] = matrix.ty;
replace[4] = matrix.tX;
replace[5] = matrix.tY;
}
- (void) takeMatrixFromTransform: (NSAffineTransform *)aTransform
@ -535,8 +535,8 @@ static NSAffineTransformStruct identityTransform = {
matrix.m12 = aTransform->matrix.m12;
matrix.m21 = aTransform->matrix.m21;
matrix.m22 = aTransform->matrix.m22;
matrix.tx = aTransform->matrix.tx;
matrix.ty = aTransform->matrix.ty;
matrix.tX = aTransform->matrix.tX;
matrix.tY = aTransform->matrix.tY;
}

View file

@ -1057,7 +1057,7 @@ scaleRect(NSRect rect, double scale)
DPSscale(ctxt, scale, scale);
if ([self isFlipped])
{
NSAffineTransformStruct ats = { 1, 0, 0, -1, 0, 1 };
NSAffineTransformStruct ats = { 1, 0, 0, -1, 0, NSHeight(_bounds) };
NSAffineTransform *matrix, *flip;
flip = [NSAffineTransform new];
matrix = [NSAffineTransform new];
@ -1069,7 +1069,6 @@ scaleRect(NSRect rect, double scale)
* the origin by the height of the view.
*/
[flip setTransformStruct: ats];
flip->matrix.ty = NSHeight(_bounds);
[matrix appendTransform: flip];
[matrix concat];
yoffset = NSHeight(_frame) - NSMaxY(pageRect);

View file

@ -40,7 +40,6 @@
#include "AppKit/NSApplication.h"
#include "AppKit/NSColor.h"
#include "AppKit/NSScrollView.h"
#include "AppKit/DPSOperators.h"
#include "AppKit/NSGraphics.h"
@interface NSTableView (GNUstepPrivate)
@ -238,12 +237,10 @@
{
NSGraphicsContext *ctxt = GSCurrentContext();
DPSsetgray(ctxt, NSBlack);
DPSrectfill(ctxt,_bounds.origin.x, _bounds.origin.y,
_bounds.size.width, 1.);
DPSrectfill(ctxt, NSMaxX(_bounds)-1., NSMinY(_bounds),
1., _bounds.size.height);
NSRectEdge up_sides[] = {NSMinYEdge, NSMaxXEdge};
float grays[] = {NSBlack, NSBlack};
NSDrawTiledRects(_bounds, aRect, up_sides, grays, 2);
}
}

View file

@ -3996,7 +3996,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
* exactly overlays the original. To do that, we must translate
* the origin by the height of the view.
*/
flip->matrix.ty = _frame.size.height;
flip->matrix.tY = _frame.size.height;
(*appImp)(_matrixToWindow, appSel, flip);
}
(*appImp)(_matrixToWindow, appSel, _boundsMatrix);