summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwcout <wcout@users.noreply.github.com>2022-12-09 06:11:42 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2022-12-09 16:55:06 +0100
commit632661fa647e5ce932bd87c8ea6f8035a8bdd264 (patch)
tree682ccb3d0a833f70cf35589a95ef8694190490da
parent36cd0a397c6d8fee7ffc5b59d607ead523226e53 (diff)
Fix Fl_Text_Display drawing of line numbers (#578)
The formerly undrawn rectangle beneath (or above) the line numbers is now filled with FL_BACKGROUND_COLOR. Additionally the small rectangle between the scrollbars is now filled with FL_BACKGROUND_COLOR instead of FL_GRAY for consistency.
-rw-r--r--src/Fl_Text_Display.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index 2df350669..0eda0ea52 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -3125,16 +3125,16 @@ void Fl_Text_Display::draw_line_numbers(bool /*clearAll*/) {
#ifndef LINENUM_LEFT_OF_VSCROLL
int vscroll_w = mVScrollBar->visible() ? mVScrollBar->w() : 0;
- if (scrollbar_align()&FL_ALIGN_LEFT)
+ if (scrollbar_align() & FL_ALIGN_LEFT)
xoff += vscroll_w;
#endif
Fl_Color fgcolor = isactive ? linenumber_fgcolor() : fl_inactive(linenumber_fgcolor());
Fl_Color bgcolor = isactive ? linenumber_bgcolor() : fl_inactive(linenumber_bgcolor());
fl_push_clip(x() + xoff,
- y() + yoff,
+ y() + Fl::box_dy(box()),
mLineNumWidth,
- h() - Fl::box_dw(box()) - hscroll_h);
+ h() - Fl::box_dh(box()));
{
// Set background color for line number area -- LZA / STR# 2621
// Erase background
@@ -3171,6 +3171,13 @@ void Fl_Text_Display::draw_line_numbers(bool /*clearAll*/) {
Y += lineHeight;
}
}
+ // fill the void area to the left of the horizontal scrollbar that exists
+ // above or beneath the line number display (when on) with background color
+ fl_color(FL_BACKGROUND_COLOR);
+ if (scrollbar_align() & FL_ALIGN_TOP)
+ fl_rectf(x() + xoff, y() + Fl::box_dy(box()), mLineNumWidth, hscroll_h);
+ else
+ fl_rectf(x() + xoff, y() + h() - hscroll_h - Fl::box_dy(box()), mLineNumWidth, hscroll_h + Fl::box_dy(box()));
fl_pop_clip();
}
@@ -3878,7 +3885,7 @@ void Fl_Text_Display::draw(void) {
if (mVScrollBar->visible() && mHScrollBar->visible())
fl_rectf(mVScrollBar->x(), mHScrollBar->y(),
mVScrollBar->w(), mHScrollBar->h(),
- FL_GRAY);
+ FL_BACKGROUND_COLOR);
}
else if (damage() & (FL_DAMAGE_SCROLL | FL_DAMAGE_EXPOSE)) {
// printf("blanking previous cursor extrusions at Y: %d\n", mCursorOldY);