[dasher] MacOSX: textSizeCallbackWithString: really shouldn't need a colour...
- From: Patrick Welche <pwelche src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dasher] MacOSX: textSizeCallbackWithString: really shouldn't need a colour...
- Date: Tue, 18 Jan 2011 17:15:54 +0000 (UTC)
commit 385f9ef587f346aaf1e8e5f61ecfb486c7fdf5b9
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date: Tue Oct 12 16:00:51 2010 +0100
MacOSX: textSizeCallbackWithString: really shouldn't need a colour...
Src/MacOSX/COSXDasherScreen.mm | 4 +---
Src/MacOSX/DasherViewAqua.h | 2 +-
Src/MacOSX/DasherViewAqua.mm | 8 +++-----
Src/MacOSX/DasherViewCocoa.h | 2 +-
Src/MacOSX/DasherViewOpenGL.h | 2 +-
Src/MacOSX/DasherViewOpenGL.mm | 2 +-
6 files changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/Src/MacOSX/COSXDasherScreen.mm b/Src/MacOSX/COSXDasherScreen.mm
index 50d81b3..0517af8 100644
--- a/Src/MacOSX/COSXDasherScreen.mm
+++ b/Src/MacOSX/COSXDasherScreen.mm
@@ -61,13 +61,11 @@ void COSXDasherScreen::Polyline(Dasher::CDasherScreen::point *Points, int Number
}
void COSXDasherScreen::DrawString(const std::string &String, int x1, int y1, int size, int iColor) {
- // TODO is that hardcoded 4 correct?
[dasherView drawTextCallbackWithString:NSStringFromStdString(String) x1:x1 y1:y1 size:size colorIndex:iColor];
}
void COSXDasherScreen::TextSize(const std::string &String, int *Width, int *Height, int size) {
- // TODO what colour should it be?
- NSSize s = [dasherView textSizeCallbackWithString:NSStringFromStdString(String) size:size colorIndex:4];
+ NSSize s = [dasherView textSizeCallbackWithString:NSStringFromStdString(String) size:size];
*Width = (int)s.width;
*Height = (int)s.height;
diff --git a/Src/MacOSX/DasherViewAqua.h b/Src/MacOSX/DasherViewAqua.h
index 9ebff31..210dbbe 100755
--- a/Src/MacOSX/DasherViewAqua.h
+++ b/Src/MacOSX/DasherViewAqua.h
@@ -50,7 +50,7 @@
- (void)keyDown:(NSEvent *)e;
- (void)circleCallbackCentrePoint:(NSPoint)aCentrePoint radius:(float)aRadius outlineColorIndex:(int)anOutlineColorIndex fillColourIndex:(int)aFillColourIndex shouldFill:(BOOL)shouldFill lineWidth:(int)aLineWidth;
- (void)rectangleCallbackX1:(int)x1 y1:(int)y1 x2:(int)x2 y2:(int)y2 fillColorIndex:(int)aFillColorIndex outlineColorIndex:(int)anOutlineColorIndex lineWidth:(int)aLineWidth;
-- (NSSize)textSizeCallbackWithString:(NSString *)aString size:(int)aSize colorIndex:(int)aColorIndex;
+- (NSSize)textSizeCallbackWithString:(NSString *)aString size:(int)aSize;
- (void)drawTextCallbackWithString:(NSString *)aString x1:(int)x1 y1:(int)y1 size:(int)aSize colorIndex:(int)aColorIndex;
- (void)polylineCallbackPoints:(NSArray *)points width:(int)aWidth colorIndex:(int)aColorIndex;
- (void)colourSchemeCallbackWithColours:(NSArray *)colours;
diff --git a/Src/MacOSX/DasherViewAqua.mm b/Src/MacOSX/DasherViewAqua.mm
index 9fb4a5e..f6ebb20 100755
--- a/Src/MacOSX/DasherViewAqua.mm
+++ b/Src/MacOSX/DasherViewAqua.mm
@@ -154,16 +154,14 @@
}
}
-- (NSSize)textSizeCallbackWithString:(NSString *)aString size:(int)aSize colorIndex:(int)aColorIndex
-{
-
- return [[[self zippyCache] zippyStringWithString:aString size:aSize attributes:[self textAttributesWithTextSize:aSize color:[self colorWithColorIndex:aColorIndex]]] size];
+- (NSSize)textSizeCallbackWithString:(NSString *)aString size:(int)aSize {
+ return [[[self zippyCache] zippyStringWithString:aString size:aSize attributes:[self textAttributesWithTextSize:aSize color:[self colorWithColorIndex:4]]] size];
}
- (void)drawTextCallbackWithString:(NSString *)aString x1:(int)x1 y1:(int)y1 size:(int)aSize colorIndex:(int)aColorIndex
{
- [[[self zippyCache] zippyStringWithString:aString size:aSize attributes:[self textAttributesWithTextSize:aSize color:[self colorWithColorIndex:aColorIndex]]] drawAtPoint:NSMakePoint(x1, y1 /*+ [self textSizeCallbackWithString:aString size:aSize colorIndex:aColorIndex].height / 2.0*/)];
+ [[[self zippyCache] zippyStringWithString:aString size:aSize attributes:[self textAttributesWithTextSize:aSize color:[self colorWithColorIndex:aColorIndex]]] drawAtPoint:NSMakePoint(x1, y1 /*+ [self textSizeCallbackWithString:aString size:aSize].height / 2.0*/)];
}
diff --git a/Src/MacOSX/DasherViewCocoa.h b/Src/MacOSX/DasherViewCocoa.h
index 3511064..5e8d5eb 100644
--- a/Src/MacOSX/DasherViewCocoa.h
+++ b/Src/MacOSX/DasherViewCocoa.h
@@ -20,7 +20,7 @@ class COSXDasherScreen;
- (void)displayCallback;
- (void)circleCallbackCentrePoint:(NSPoint)aCentrePoint radius:(float)aRadius outlineColorIndex:(int)anOutlineColorIndex fillColourIndex:(int)aFillColourIndex shouldFill:(BOOL)shouldFill lineWidth:(int)aLineWidth;
- (void)rectangleCallbackX1:(int)x1 y1:(int)y1 x2:(int)x2 y2:(int)y2 fillColorIndex:(int)aFillColorIndex outlineColorIndex:(int)anOutlineColorIndex lineWidth:(int)aLineWidth;
-- (NSSize)textSizeCallbackWithString:(NSString *)aString size:(int)aSize colorIndex:(int)aColorIndex;
+- (NSSize)textSizeCallbackWithString:(NSString *)aString size:(int)aSize;
- (void)drawTextCallbackWithString:(NSString *)aString x1:(int)x1 y1:(int)y1 size:(int)aSize colorIndex:(int)aColorIndex;
- (void)polygonCallbackPoints:(NSArray *)points fillColorIndex:(int)fColorIndex outlineColorIndex:(int)iColorIndex lineWidth:(int)aWidth;
- (void)polylineCallbackPoints:(NSArray *)points width:(int)aWidth colorIndex:(int)aColorIndex;
diff --git a/Src/MacOSX/DasherViewOpenGL.h b/Src/MacOSX/DasherViewOpenGL.h
index 4eb5b8e..f6a23b6 100755
--- a/Src/MacOSX/DasherViewOpenGL.h
+++ b/Src/MacOSX/DasherViewOpenGL.h
@@ -65,7 +65,7 @@ typedef struct {
- (void)circleCallbackCentrePoint:(NSPoint)aCentrePoint radius:(float)aRadius outlineColorIndex:(int)anOutlineColorIndex fillColourIndex:(int)aFillColourIndex shouldFill:(BOOL)shouldFill lineWidth:(int)aLineWidth;
- (void)rectangleCallbackX1:(int)x1 y1:(int)y1 x2:(int)x2 y2:(int)y2 fillColorIndex:(int)aFillColorIndex outlineColorIndex:(int)anOutlineColorIndex lineWidth:(int)aLineWidth;
- (AlphabetLetter *)letterForString:(NSString *)aString;
-- (NSSize)textSizeCallbackWithString:(NSString *)aString size:(int)aSize colorIndex:(int)aColorIndex;
+- (NSSize)textSizeCallbackWithString:(NSString *)aString size:(int)aSize;
- (void)drawTextCallbackWithString:(NSString *)aString x1:(int)x1 y1:(int)y1 size:(int)aSize colorIndex:(int)aColorIndex;
- (void)colourSchemeCallbackWithColourTable:(colour_t *)aColourTable;
- (void)polygonCallbackPoints:(NSArray *)points fillColorIndex:(int)fColorIndex outlineColorIndex:(int)iColorIndex lineWidth:(int)aWidth;
diff --git a/Src/MacOSX/DasherViewOpenGL.mm b/Src/MacOSX/DasherViewOpenGL.mm
index 47867d4..49e38ba 100755
--- a/Src/MacOSX/DasherViewOpenGL.mm
+++ b/Src/MacOSX/DasherViewOpenGL.mm
@@ -199,7 +199,7 @@
return result;
}
-- (NSSize)textSizeCallbackWithString:(NSString *)aString size:(int)aSize colorIndex:(int)aColorIndex
+- (NSSize)textSizeCallbackWithString:(NSString *)aString size:(int)aSize
{
return [[self letterForString:aString] sizeWithSize:aSize];
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]