| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
The attached PR should resolve this (I think). The corners of the hash pattern were not getting inked. Using parallel lines of the same length, rather than lines that shrink to zero length in the corners, seems to fix this problem. Agg draws a zero length line as nothing, whereas other renderers (Adobe Acrobat, for example) draw a zero length line as a point. There is also a bug whereby the density of diagonal lines was much higher than horizontal or vertical ones so the spacing should be less crowded now. They can't be made to be the same, because the pattern is a fixed size regardless of line direction, so if the spacing of horizontal lines is 'x', the spacing of diagonal lines is \sqrt{2x^2}. |
Sorry, something went wrong.
There was a problem hiding this comment.
This is not good when num_lines == 0 as we end up with a single point in the hatch pattern. 7242fd67921fff5c7651692e097cfdb7dde174ab, in my own branch from yours, fixes this and adds a fix to the anti-aliasing effect on horizontal and vertical hatches.
Sorry, something went wrong.
|
Awesome response time Mike. It took me ages to look into this without success! (I guess my initial guess that it was an aa effect is to blame for that) |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Every 72 pixels, with some hatch patterns, the hatch line is interrupted in the agg backend.
ax = plt.axes() patch = mpatches.Rectangle([0, 0], 1, 1, transform=ax.transAxes, hatch='/', facecolor='none') ax.add_patch(patch) # put boxes where there are gaps (in device pixel coordinates) fig = plt.gcf() w, h = fig.transFigure.transform([1, 1]) box_height = 11 box1_x, box1_y = 144 - box_height/2, h - 145 + box_height/2 for i in xrange(3): for j in xrange(3): patch = mpatches.Rectangle([box1_x + i*72, box1_y - j*72], box_height, box_height, transform=None, facecolor='none') fig.patches.append(patch) plt.show()An interesting observation is that when using the hatch "x" the artefact doesn't exist, which suggests there may be an anti-aliasing influence at the edge of the tile before it is passed through as an agg::span_pattern_rgba.
I have tried changing the agg renderer in src/_backend_agg.cpp to renderer_bin for hatch pattern rendering, in the hope that it would be a simple anti-aliasing problem, but the problem persists. Unfortunately that is as far as I have been able to take it.