SVG symbol gets clipped when rotated #5264

Merged
merged 1 commit into from Sep 20, 2016

Projects

None yet

3 participants

@olt
Contributor
olt commented Mar 23, 2016

Non-square SVG symbols are clipped when they are rotated.

Here is an example where a small box of 40x20 pixel is rotated by 45 and 90 degrees:

out

Here is the Mapfile and SVG symbol:
https://gist.github.com/olt/2a345fe22653cd021c29

Tested this with current master, 7.0.1 and 6.4.3 (shp2img -m clipped-symbol.map -o out.png).

@olt olt added a commit to olt/mapserver that referenced this pull request Mar 23, 2016
@olt olt fix surface size when rastering rotated SVG symbols
fixes #5264
c8d99c5
@olt
Contributor
olt commented Mar 23, 2016

Found the issue. The surface size in msRenderRasterizedSVGSymbol is too small. There is a compensation for 45 degree rotations, but it fails for larger rotations.

Here is a short fix:
olt@3b9364e

@olt olt added a commit to olt/mapserver that referenced this pull request Mar 23, 2016
@olt olt fix surface size when rastering rotated SVG symbols
fixes #5264
3b9364e
@tbonfort tbonfort added a commit to tbonfort/mapserver that referenced this pull request Mar 23, 2016
@olt @tbonfort olt + tbonfort fix surface size when rastering rotated SVG symbols
fixes #5264
82b00cd
@olt @tbonfort olt fix surface size when rastering rotated SVG symbols
fixes #5264
dc091b2
@tbonfort tbonfort self-assigned this Jun 29, 2016
@tbonfort tbonfort added this to the 7.0.2 Release milestone Jun 29, 2016
@jmckenna
Member

I've tested this fix on Ubuntu through librsvg with branch-7.0 + this change. Is this ok to merge?
ttt

@jmckenna jmckenna merged commit e03ca4b into mapserver:branch-7-0 Sep 20, 2016

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@jmckenna
Member

thanks @olt !

@tbonfort tbonfort added a commit that referenced this pull request Sep 20, 2016
@tbonfort tbonfort Fix tests afeter #5264 45b3917
@tbonfort
Member

A PR which breaks tests isn't ready for inclusion, please wait for confirmation before merging PRs you are not affiliated with. Fix added in 45b3917

@tbonfort tbonfort deleted the tbonfort:clipped-symbols-5264 branch Sep 20, 2016
@jmckenna
Member

for the record i had begun looking at the 2 errors reported by msautotest. thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment