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
translatewe can do this.Check out rectangle and rounded rectangle figures in the latest commit in
figure-fixesbranch 😉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.ExtendedGraphicsToGraphics2DAdaptororg.eclipse.swt.graphics.Pathfor drawing fills instead oforg.eclipse.draw2d.geometry.PointList.The key is to use
org.eclipse.swt.graphics.Pathfor drawing where possible.Here’s an example of
AbstractMotivationFigurebefore 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.PointListinto aorg.eclipse.swt.graphics.Path.By doing this we can draw with more accuracy.
All of this is in the
figure-fixesbranch.I’ll release another beta.