summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2024-08-12 12:22:20 +0200
committerMatthias Melcher <github@matthiasm.com>2024-08-12 12:22:25 +0200
commit3922ef67c138511b57f40c8a1f205f1d6716d4fc (patch)
tree4bff6b89691c87c55ba0182f6d3140b9f07abfbc /FL
parent2013c4fd67c5f4f6bf7d3082a47272d6a5ad5acc (diff)
Further accelerating Fl_Text_Display (#596)
This commit adds lazy evaluation for the wrapped line calculation, making scrolling much more interactive.
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Text_Display.H4
1 files changed, 4 insertions, 0 deletions
diff --git a/FL/Fl_Text_Display.H b/FL/Fl_Text_Display.H
index c736db1e0..b5625d04d 100644
--- a/FL/Fl_Text_Display.H
+++ b/FL/Fl_Text_Display.H
@@ -433,6 +433,7 @@ public:
void wrap_mode(int wrap, int wrap_margin);
virtual void recalc_display();
+ virtual void display_needs_recalc();
void resize(int X, int Y, int W, int H) FL_OVERRIDE;
/**
@@ -628,6 +629,9 @@ protected:
needs to be mutable so that it can be calculated
within a method marked as "const" */
+ bool display_needs_recalc_; /* Set to true when the display needs
+ to be recalculated. */
+
Fl_Color mCursor_color;
Fl_Scrollbar* mHScrollBar;