#3868 closed defect (fixed)
Grid of thin lines in polygon symbol fills
Reported by: | havatv | Owned by: | tbonfort |
---|---|---|---|
Priority: | normal | Milestone: | 6.2 release |
Component: | Renderer API | Version: | svn-trunk (development) |
Severity: | normal | Keywords: | polygon fill, gaps, rendering |
Cc: | havatv, sdlime |
Description
In maprendering.c, when rendering polygon fills using symbols, 1 is added to the symbol size in both the x and the y direction for scaled symbols:
652 if(s.scale != 1) { 653 pw = MS_NINT(symbol->sizex * s.scale + s.gap)+1; 654 ph = MS_NINT(symbol->sizey * s.scale + s.gap)+1; 655 } else { 656 pw = symbol->sizex + s.gap; 657 ph = symbol->sizey + s.gap; 658 }
This produced a grid of thin lines of "background" colour in the polygon fill at the symbol boundaries (both for GD and AGG).
I am not that familiar with the code, but since the GD renderer does not do anti-aliasing, eliminating the one unit addition should make it easier to get good polygon fill rendering with GD.
I have tried to remove the one unit addition, and if I am careful with the SIZE, the result looks better (both for GD and AGG). It does not seem to produce worse looking results for non-optimal SIZEs. But it might of course have other unwanted side effect.
Attachments (8)
Change History (14)
comment:1 by , 13 years ago
Milestone: | 6.0 release → 6.0.1 release |
---|
by , 13 years ago
Attachment: | polyfill_whitespace600.png added |
---|
by , 13 years ago
Attachment: | polyfill_whitespace_ellipse600.png added |
---|
by , 13 years ago
Attachment: | polyfill_whitespace_ellipse600_patched.png added |
---|
patched version (ellipse)
by , 13 years ago
Attachment: | polyfill_whitespace_ellipse600_patched.gif added |
---|
gif patched versoin (ellipse)
comment:2 by , 13 years ago
The attachments show the effects of the patch for vector symbol fill and ellipse symbol fill for gif (GD) and png (AGG).
comment:3 by , 13 years ago
Keywords: | rendering added; gd removed |
---|---|
Milestone: | 6.0.1 release → 6.2 release |
comment:4 by , 13 years ago
Cc: | added |
---|
It would have been very nice to get some feedback on this one.
Could somebody explain why the extra pixel is added to the size in the current code, and why it would be a problem to remove it.
If there is no problem, I hope that the patch can be applied, as current behaviour is a showstopper for many "advanced" area fill symbols of type vector.
comment:5 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
fixed in r12707.
the reason this pixel was added was to account for the antialiasing of vectors which bleeds out of the strict bounding box given by the symbol's size. The workaround in that case will be to add a sufficient GAP to account for this.
Some more on this one.
I have done the simple fix that I suggested. Here is the diff (6.0.0 branch, but probably the same in trunk):
I attach images that show the change in behaviour.