summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-09-30 13:41:43 +0200
committerMatthias Melcher <github@matthiasm.com>2023-09-30 13:41:49 +0200
commit76b16d8cef24c4c548e21dad90cf2f8731ffceb9 (patch)
tree3e75f5cefe3f82b43f4ed9baa51f085ed1453d22
parenta1f47148a3fa89b731f2163dacaf768852e4d6f9 (diff)
Fixes Fl_Tabs clipping offset
-rw-r--r--src/Fl_Tabs.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx
index 9d4b51a2d..f984f6e2e 100644
--- a/src/Fl_Tabs.cxx
+++ b/src/Fl_Tabs.cxx
@@ -849,7 +849,7 @@ void Fl_Tabs::draw() {
// between tabs.
clip_left = x();
for (i=0; i<safe_selected; i++) {
- clip_right = (i<tab_count-1) ? x()+(tab_pos[i+1]+tab_width[i+1]/2) : x() + w();
+ clip_right = (i<tab_count-1) ? x()+(tab_offset+tab_pos[i+1]+tab_width[i+1]/2) : x() + w();
fl_push_clip(clip_left, tabs_y, clip_right-clip_left, tabs_h);
draw_tab(x()+tab_pos[i], x()+tab_pos[i+1],
tab_width[i], H, child(i), tab_flags[i], LEFT);
@@ -858,7 +858,7 @@ void Fl_Tabs::draw() {
// draw all tabs from the rightmost back to the selected one, also visually stacking them
clip_right = x() + w();
for (i=children()-1; i > safe_selected; i--) {
- clip_left = (i>0) ? (tab_pos[i]-tab_width[i-1]/2) : x();
+ clip_left = (i>0) ? (tab_offset+tab_pos[i]-tab_width[i-1]/2) : x();
fl_push_clip(clip_left, tabs_y, clip_right-clip_left, tabs_h);
draw_tab(x()+tab_pos[i], x()+tab_pos[i+1],
tab_width[i], H, child(i), tab_flags[i], RIGHT);