From 3922ef67c138511b57f40c8a1f205f1d6716d4fc Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 12 Aug 2024 12:22:20 +0200 Subject: Further accelerating Fl_Text_Display (#596) This commit adds lazy evaluation for the wrapped line calculation, making scrolling much more interactive. --- FL/Fl_Text_Display.H | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'FL') 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; -- cgit v1.2.3