TextDocumentLayout: Use Invalidate() instead of InvalidateParagraphs()
Added TODO about which data the TextChangedEvent should have in order to know how to respond in the TextDocumentLayout. For now, update all paragraphs in the layout, add new ones as necessary, and remove the ones we have in excess by using Invalidate().
This commit is contained in:
parent
1fa37d5af8
commit
9a8dd79cc2
@ -28,8 +28,16 @@ public:
|
||||
printf("TextChanged(%" B_PRIi32 ", %" B_PRIi32 ")\n",
|
||||
event.FirstChangedParagraph(),
|
||||
event.ChangedParagraphCount());
|
||||
fLayout->InvalidateParagraphs(event.FirstChangedParagraph(),
|
||||
event.ChangedParagraphCount());
|
||||
// TODO: The event does not contain useful data. Make the event
|
||||
// system work so only the affected paragraphs are updated.
|
||||
// I think we need "first affected", "last affected" (both relative
|
||||
// to the original paragraph count), and than how many new paragraphs
|
||||
// are between these. From the difference in old number of paragraphs
|
||||
// inbetween and the new count, we know how many new paragraphs are
|
||||
// missing, and the rest in the range needs to be updated.
|
||||
// fLayout->InvalidateParagraphs(event.FirstChangedParagraph(),
|
||||
// event.ChangedParagraphCount());
|
||||
fLayout->Invalidate();
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user