Skip to content

Commit

Permalink
Fix line number alignment in Fl_Text_Display/Editor (STR #3363).
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12170 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Albrecht Schlosser committed Feb 4, 2017
1 parent cbc5a48 commit 759d2f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions CHANGES
Expand Up @@ -42,13 +42,14 @@ Changes in FLTK 1.4.0 Released: ??? ?? 2017

Other Improvements

- (add here)
- (add new items here)
- Many documentation fixes, clarifications, and enhancements.


Bug Fixes

- (add here)
- (add new items here)
- Fix line number alignment in Fl_Text_Display/Editor (STR #3363).
- Fix ignored buffer pre-allocation (requestedSize) in Fl_Text_Buffer.
See fltk.general "Fl_Text_Buffer constructor bug" on Dec 5, 2016.
- Fix build with configure --enable-cairo --enable-cairoext,
Expand Down
4 changes: 2 additions & 2 deletions src/Fl_Text_Display.cxx
Expand Up @@ -2914,7 +2914,7 @@ void Fl_Text_Display::draw_line_numbers(bool /*clearAll*/) {
// Take scrollbars and positions into account.
int hscroll_h = mHScrollBar->visible() ? mHScrollBar->h() : 0;
int xoff = Fl::box_dx(box());
int yoff = Fl::box_dy(box()) + ((scrollbar_align()&FL_ALIGN_TOP)?hscroll_h:0);
int yoff = text_area.y - y();

#ifndef LINENUM_LEFT_OF_VSCROLL
int vscroll_w = mVScrollBar->visible() ? mVScrollBar->w() : 0;
Expand Down Expand Up @@ -2951,7 +2951,7 @@ void Fl_Text_Display::draw_line_numbers(bool /*clearAll*/) {
if (lineStart != -1 && (lineStart==0 || buffer()->char_at(lineStart-1)=='\n')) {
sprintf(lineNumString, linenumber_format(), line);
int xx = x() + xoff + 3,
yy = Y + 3,
yy = Y,
ww = mLineNumWidth - (3*2),
hh = lineHeight;
fl_draw(lineNumString, xx, yy, ww, hh, linenumber_align(), 0, 0);
Expand Down

0 comments on commit 759d2f1

Please sign in to comment.