summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2004-09-13 00:30:08 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2004-09-13 00:30:08 +0000
commit12993c9e4352353960a97882bd057fe3b7b5a32b (patch)
tree5d6c28d825e62f461d23bd049dc1633977d9588a
parent70dd6151c1d16efc5d6214949266db0ccae0abfa (diff)
Fix QuickDraw code typo.
Fix fl_width() for QuickDraw (now uses MacRoman encoded text...) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3823 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/fl_font_mac.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/fl_font_mac.cxx b/src/fl_font_mac.cxx
index eabe3d189..8b0ff50b5 100644
--- a/src/fl_font_mac.cxx
+++ b/src/fl_font_mac.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_font_mac.cxx,v 1.1.2.22 2004/09/09 21:34:47 matthiaswm Exp $"
+// "$Id: fl_font_mac.cxx,v 1.1.2.23 2004/09/13 00:30:08 easysw Exp $"
//
// MacOS font selection routines for the Fast Light Tool Kit (FLTK).
//
@@ -242,15 +242,15 @@ const char *fl_iso2macRoman(const char *s, int n) {
}
double fl_width(const char* c, int n) {
+ const char *txt = fl_iso2macRoman(c, n);
#ifdef __APPLE_QD__
- return (double)TextWidth( c, 0, n );
+ return (double)TextWidth( txt, 0, n );
#else
if (!fl_gc) {
Fl_Window *w = Fl::first_window();
if (w) w->make_current();
if (!fl_gc) return -1;
}
- const char *txt = fl_iso2macRoman(c, n);
// according to the Apple developer docs, this is the correct way to
// find the length of a rendered text...
CGContextSetTextPosition(fl_gc, 0, 0);
@@ -276,11 +276,11 @@ void fl_draw(const char* str, int n, int x, int y) {
#ifdef __APPLE_QD__
const char *txt = fl_iso2macRoman(str, n);
MoveTo(x, y);
- DrawText((const char *)buf, 0, n);
+ DrawText((const char *)txt, 0, n);
#elif defined(__APPLE_QUARTZ__)
fl_draw(str, n, (float)x, (float)y);
#else
-# error : neither Quartz no Quickdraw chosen
+# error : neither Quartz no Quickdraw chosen
#endif
}
@@ -291,10 +291,10 @@ void fl_draw(const char *str, int n, float x, float y) {
const char *txt = fl_iso2macRoman(str, n);
CGContextShowTextAtPoint(fl_gc, x, y, txt, n);
#else
-# error : neither Quartz no Quickdraw chosen
+# error : neither Quartz no Quickdraw chosen
#endif
}
//
-// End of "$Id: fl_font_mac.cxx,v 1.1.2.22 2004/09/09 21:34:47 matthiaswm Exp $".
+// End of "$Id: fl_font_mac.cxx,v 1.1.2.23 2004/09/13 00:30:08 easysw Exp $".
//