Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#2868 closed defect (fixed)

agg rendering offset x -99 lines trouble

Reported by: szigeti Owned by: sdlime
Priority: normal Milestone: 5.4 release
Component: AGG Version: svn-trunk (development)
Severity: normal Keywords: agg offset
Cc: tbonfort

Description

There are adjacent lines of direction dx/dy==2 (probably also 1/2, -1/2 or -2) in the same shape object. E.g.: FEATURE POINTS 0 0 200 100 300 150 END END . Offset style is used with y=-99. This scenario may turn the agg renderer into long (probably infinite) loop.

The attached mapfile contain various examples (commented out) related to this bug.

Attachments (2)

linetest.map (903 bytes ) - added by szigeti 15 years ago.
maputils.patch (7.1 KB ) - added by szigeti 15 years ago.
rewritten msOffsetPolyline that fixes the bug

Download all attachments as: .zip

Change History (11)

by szigeti, 15 years ago

Attachment: linetest.map added

comment:1 by szigeti, 15 years ago

My home-made bugfix: set float par=0.7071 instead of 0.71 for better sqrt(0.5) approximation in shapeObj* msOffsetPolyline(shapeObj *p, double offsetx, double offsety) function (maputil.c).

Note, it is not the best overall solution, but for me it works:)

by szigeti, 15 years ago

Attachment: maputils.patch added

rewritten msOffsetPolyline that fixes the bug

comment:2 by szigeti, 15 years ago

http://trac.osgeo.org/mapserver/attachment/ticket/2868/maputils.patch

I have introduced some vector primitives (pointObj functions), e.g., addition subtraction, resize, rotation, etc. and have rewritten the msOffsetPolyline function. Feel free to to apply this changes to the trunk in your own coding style.

Note that for the sake of simplicity I have used the type pointObj everywhere insead vectors - in fact point - point = vector, point + vector = point, vector + vector = vector, etc.

comment:3 by sdlime, 15 years ago

Component: MapServer C LibraryAGG
Owner: changed from sdlime to tbonfort

comment:4 by sdlime, 15 years ago

Cc: sdlime added

comment:5 by sdlime, 15 years ago

Cc: tbonfort added; sdlime removed
Owner: changed from tbonfort to sdlime

Seems to work ok, want to look things over before committing...

Steve

comment:6 by sdlime, 15 years ago

Status: newassigned

comment:7 by sdlime, 15 years ago

Milestone: 5.4 release

comment:8 by sdlime, 15 years ago

Resolution: fixed
Status: assignedclosed

The limited testing I did was successful (perhaps GD should use this too). I did just a bit of format clean up and committed in time for beta 2 (r8613). Thanks for the patch!

Can I assume all contributions are legally unencumbered (i.e. yours to make) and are now covered by the MapServer license?

Steve

in reply to:  8 comment:9 by szigeti, 15 years ago

Replying to sdlime:

Can I assume all contributions are legally unencumbered (i.e. yours to make) and are now covered by the MapServer license?

Yes, of course, and moving the vector helper functions into mapprimitive.c is also a good idea. But these vector primitives are certainly implemented in other libs as well. Just to avoid redundancy:)

Note: See TracTickets for help on using tickets.