Skip to content

Commit

Permalink
Mac OS X: fixed bug where fl_draw(const char*, int, float, float) wou…
Browse files Browse the repository at this point in the history
…ld not work on non-Quartz device

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7654 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Manolo Gouy authored and Manolo Gouy committed Jun 24, 2010
1 parent a401669 commit 142cefd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions FL/Fl_Device.H
Expand Up @@ -128,6 +128,9 @@ protected:
friend void fl_line(int x, int y, int x1, int y1);
friend void fl_line(int x, int y, int x1, int y1, int x2, int y2);
friend void fl_draw(const char *str, int n, int x, int y);
#ifdef __APPLE__
friend void fl_draw(const char *str, int n, float x, float y);
#endif
friend void fl_draw(int angle, const char *str, int n, int x, int y);
friend void fl_rtl_draw(const char *str, int n, int x, int y);
friend void fl_font(Fl_Font face, Fl_Fontsize size);
Expand Down
4 changes: 4 additions & 0 deletions src/fl_font_mac.cxx
Expand Up @@ -425,6 +425,10 @@ static CGColorRef flcolortocgcolor(Fl_Color i)

void fl_draw(const char *str, int n, float x, float y) {

if(fl_device->type() != Fl_Quartz_Graphics_Driver::device_type) {
fl_device->draw(str, n, (int)x, (int)y );
return;
}
// avoid a crash if no font has been selected by user yet !
check_default_font();
// convert to UTF-16 first
Expand Down

0 comments on commit 142cefd

Please sign in to comment.