TipHtmlPanel tweak for faster drawing
Original Reporter info from Mantis: serbod
-
Reporter name:
Original Reporter info from Mantis: serbod
- Reporter name:
Description:
About 3x faster page drawing - in procedure TIpNodeBlockLayouter.DoRenderElemWord()
replace
FCanvas.TextRect(R, P.x, P.y, NoBreakToSpace(aCurWord.AnsiWord), TextStyle);
by
if aCurWord.AnsiWord = ' ' then
P.X := P.X + 1;
TextStyle.Clipping := False;
FCanvas.TextStyle := TextStyle;
FCanvas.TextOut(P.x, P.y, NoBreakToSpace(aCurWord.AnsiWord))
Some magic with space char need because calculated text length mismath, and space chars hides last pixels of words.
Additional information:
Every text on page splitted to words and spaces. And every word and space measured, positioned and displayed separately. More words visible - more time need to draw them.
Test project with patched files attached, click "Refresh" to measure paint speed. Checkboxes allow swith between default and new behavior.
Mantis conversion info:
- Mantis ID: 38318
- Version: 2.1 (SVN)