HaikuDepot TextView: add a way to relayout when document changed

When adding new paragraphs or otherwise editing a document from outside
the view, the layout needs to be recomputed and the view invalidated.
Otherwise, the changed text is not shown.

Change-Id: Id3c60d8b510443f71ebbc805b7b7ca5b35220fd5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7131
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
PulkoMandy
2023-12-11 08:18:44 +00:00
committed by Adrien Destugues
parent 6af1381397
commit 4f9df95dc8
2 changed files with 10 additions and 0 deletions
@@ -447,6 +447,14 @@ TextDocumentView::Copy(BClipboard* clipboard)
}
void
TextDocumentView::Relayout()
{
fTextDocumentLayout.Invalidate();
_UpdateScrollBars();
}
// #pragma mark - private
@@ -49,6 +49,8 @@ public:
virtual void GetHeightForWidth(float width, float* min,
float* max, float* preferred);
virtual void Relayout();
// TextDocumentView interface
void SetTextDocument(
const TextDocumentRef& document);