... | ... | @@ -556,7 +556,7 @@ This just iterates thorugh the lines until one is visible and draws it. Drawing |
|
|
```java
|
|
|
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!)
|
|
|
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!) If we want to draw a different Font we only need to provide a setter and delegate the call of ```setFont()``` to our superclass ```Canvas```. This assures that the gc knows this font when drawing!
|
|
|
|
|
|
# A few notes about the rendering
|
|
|
|
... | ... | @@ -570,8 +570,11 @@ Things that can be made faster: |
|
|
|
|
|
* Binary search for the wrapping
|
|
|
* Only iterate through the visible lines instead of all lines while drawing
|
|
|
* faster rendering if we have a horizontal scrollbar
|
|
|
|
|
|
Things that are still missing:
|
|
|
|
|
|
* Allowing the text to be edited
|
|
|
* Respecting left and right margins
|
|
|
* usage of styleranges
|
|
|
* individual line heights |