diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-06-09 13:35:49 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-06-09 13:35:49 +0000 |
| commit | 13ae564f03a3ea7dd86e218fb287363842371cba (patch) | |
| tree | 28f0478578cd2be81328e60b1c8c4608b411e434 /src/Fl_Text_Display.cxx | |
| parent | d769df9a59601459c26f3ba9b18b0bdba2f36855 (diff) | |
Add color definitions for "dark red", etc.
Change "text" and "selecion" methods to return char *, not const char *,
since they return a changeable copy of the text.
Add range checking to style lookup in Fl_Text_Display.
Add syntax hilighting to editor example.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2299 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Text_Display.cxx')
| -rw-r--r-- | src/Fl_Text_Display.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index 7a493dda9..8a4c85075 100644 --- a/src/Fl_Text_Display.cxx +++ b/src/Fl_Text_Display.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Text_Display.cxx,v 1.12.2.16 2002/06/06 14:04:53 easysw Exp $" +// "$Id: Fl_Text_Display.cxx,v 1.12.2.17 2002/06/09 13:35:49 easysw Exp $" // // Copyright 2001-2002 by Bill Spitzak and others. // Original code Copyright Mark Edel. Permission to distribute under @@ -1656,6 +1656,9 @@ int Fl_Text_Display::measure_vline( int visLineNum ) { style = ( unsigned char ) mStyleBuffer->character( lineStartPos + i ) - 'A'; + if (style < 0) style = 0; + else if (style >= mNStyles) style = mNStyles - 1; + fl_font( mStyleTable[ style ].font, mStyleTable[ style ].size ); width += ( int ) fl_width( expandedChar, len ); @@ -1948,5 +1951,5 @@ int Fl_Text_Display::handle(int event) { // -// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.16 2002/06/06 14:04:53 easysw Exp $". +// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.17 2002/06/09 13:35:49 easysw Exp $". // |
