archi: Not using ScaledGraphics class degrades quality at higher zoom
In order to fix #621 we removed the use of the org.eclipse.draw2d.ScaledGraphics
class. However, looking closer at some zoomed diagrams there are now new issues:
- The outer rectangle of a box is misaligned on right and bottom sides
- Fonts are not smooth
- Other artefacts
- Fonts loaded via
Display#loadFont()
are not scaled and rendered correctly (see #628)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 57 (57 by maintainers)
I’ve just tested and everything seems ok. Good !
It only took 10 years… 😉
Yes. The problem is that in most cases we want x and y to be 0.5 pixel indented. With
translate
we can do this.Check out rectangle and rounded rectangle figures in the latest commit in
figure-fixes
branch 😉I’ve made progress on the Figures. I want to get us to where we were before removing
ScaledGraphics
. And once that is done we can think about setting line widths later.ExtendedGraphicsToGraphics2DAdaptor
org.eclipse.swt.graphics.Path
for drawing fills instead oforg.eclipse.draw2d.geometry.PointList
.The key is to use
org.eclipse.swt.graphics.Path
for drawing where possible.Here’s an example of
AbstractMotivationFigure
before these changes. This usesGraphics.fillPolygon(points)
:And this one uses
Graphics.fillPath(path)
:I wrote a utility method to convert the co-ordinates of
org.eclipse.draw2d.geometry.PointList
into aorg.eclipse.swt.graphics.Path
.By doing this we can draw with more accuracy.
All of this is in the
figure-fixes
branch.I’ll release another beta.