1

Closed

Change Polygon Line Width causes System.OverflowException

description

Double click a polygon symbol from the legend to bring up the "Polygon Symbolizer Properties"
 
Under "Outline", delete the width number to enter a new number. The program crashes with a
"System.OverflowException: Overflow error."
 
Under the same instances with a line shapefile, the program appears to have built in error checking when that number is deleted to enter a new value
Closed Apr 17, 2012 at 4:02 PM by mudnug

comments

mudnug wrote Apr 12, 2012 at 2:08 AM

Thanks for the report. If you have time, please recommend which lines of code to modify and how to modify them!

TTGeo_User wrote Apr 13, 2012 at 5:41 PM

No worries mudnug, I think I figured out the issue but haven't figured out how to correct it yet.
The issue arises in DotSpatial.Symbology.LineSymbolizer.cs under the DrawPath Function.

public virtual void DrawPath(Graphics g, GraphicsPath gp, double scaleWidth)
    {
        foreach (IStroke stroke in _strokes)
        {
            Pen p = stroke.ToPen(scaleWidth);
            g.DrawPath(p, gp);
            p.Dispose();
        }
    }
it errors out at g.DrawPath(p,gp);

p appears to have a width of NaN which would explain why it is crashing. Some more looking into and I may figure out how to fix it.

mudnug wrote Apr 17, 2012 at 3:58 PM

There's a spot in LineSymbolizer where double rat = width / GetWidth(); causes a divide by zero. I'll look into this further.

wrote Apr 17, 2012 at 4:02 PM

Resolved with changeset 66596.