summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2017-02-04 21:56:38 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2017-02-04 21:56:38 +0000
commit759d2f1c99560468e17d656d395db87796deea94 (patch)
tree4b7a3d924228220c40c4833db41497db29c40dd4
parentcbc5a4842de3e4f0b2adb366804f7d2c73236078 (diff)
Fix line number alignment in Fl_Text_Display/Editor (STR #3363).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12170 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES5
-rw-r--r--src/Fl_Text_Display.cxx4
2 files changed, 5 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 8f2cf5bac..8b9ee73b9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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,
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index 0c795d43b..23814fb7f 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -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;
@@ -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);