... | ... | @@ -558,6 +558,12 @@ gcOff.drawString(line.getContent(), 0, yOffset, true); |
|
|
```
|
|
|
Note the last argument, which tells SWT to only draw the text using a transparent background (we want our annotations to be visible and not overwritten by the background of the text all the time - and the background is a box!)
|
|
|
|
|
|
# A few notes about the rendering
|
|
|
|
|
|
Drawing the text line by line (and this is repeated many times) would result in flickering. This is why in this case, the principle of offscreen rendering was chosen. This renders the lines in an image which is yet invisible and -once complete - draws the entire image at once. The concept is illustrated here:
|
|
|
|
|
|
[Offscreen rendering (or double buffered renderign)](http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/DemonstratesanimationItusesdoublebuffering.html)
|
|
|
|
|
|
To be continued...
|
|
|
|
|
|
Things that can be made faster:
|
... | ... | |