From: Jeff R. <jef...@us...> - 2005-11-20 20:42:34
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorObjectModel/SharpVectors/dom/svg/Document Structure In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1906/src/SharpVectorObjectModel/SharpVectors/dom/svg/Document Structure Modified Files: SvgDocument.cs SvgImageElement.cs SvgTransformableElement.cs Log Message: Project wide fixes to eliminate obsolete NUnit calls, minor test related fixes Index: SvgDocument.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorObjectModel/SharpVectors/dom/svg/Document Structure/SvgDocument.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SvgDocument.cs 19 Nov 2005 03:13:23 -0000 1.3 +++ SvgDocument.cs 20 Nov 2005 20:42:23 -0000 1.4 @@ -245,7 +245,7 @@ } return; - LocalDtdXmlUrlResolver localDtdXmlUrlResolver = new LocalDtdXmlUrlResolver(); + /*LocalDtdXmlUrlResolver localDtdXmlUrlResolver = new LocalDtdXmlUrlResolver(); localDtdXmlUrlResolver.AddDtd("http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd", @"dtd\svg10.dtd"); localDtdXmlUrlResolver.AddDtd("http://www.w3.org/TR/SVG/DTD/svg10.dtd", @"dtd\svg10.dtd"); localDtdXmlUrlResolver.AddDtd("http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd", @"dtd\svg11-tiny.dtd"); @@ -260,7 +260,7 @@ valReader.XmlResolver = localDtdXmlUrlResolver; } - this.XmlResolver = localDtdXmlUrlResolver; + this.XmlResolver = localDtdXmlUrlResolver;*/ } /// <overloads> Index: SvgTransformableElement.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorObjectModel/SharpVectors/dom/svg/Document Structure/SvgTransformableElement.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SvgTransformableElement.cs 19 Nov 2005 03:13:23 -0000 1.3 +++ SvgTransformableElement.cs 20 Nov 2005 20:42:23 -0000 1.4 @@ -70,11 +70,6 @@ GraphicsPath gp = gdiPathElm.GetGraphicsPath(); SvgMatrix svgMatrix = (SvgMatrix)this.GetScreenCTM(); RectangleF bounds = gp.GetBounds(svgMatrix.ToMatrix()); - string strokeWidth = this.GetPropertyValue("stroke-width"); - if(strokeWidth.Length == 0) strokeWidth = "1px"; - SvgLength strokeWidthLength = new SvgLength(this, "stroke-width", SvgLengthDirection.Viewport, strokeWidth); - float sw = (float)strokeWidthLength.Value; - margin += sw; bounds = RectangleF.Inflate(bounds, margin, margin); return bounds; } @@ -249,7 +244,10 @@ //TODO this is still fairly experimental, a margin of 20 gives us some overlap for leeway //TODO in general, overlap is necessary to handle strokes, which are not covered in bbox, but are //TODO for rendering purposes (same with markers) - renderingNode.ScreenRegion = GetBRect(0); + string strokeWidth = this.GetPropertyValue("stroke-width"); + if(strokeWidth.Length == 0) strokeWidth = "1px"; + SvgLength strokeWidthLength = new SvgLength(this, "stroke-width", SvgLengthDirection.Viewport, strokeWidth); + renderingNode.ScreenRegion = GetBRect((float)strokeWidthLength.Value); } } @@ -259,15 +257,19 @@ { base.CssInvalidate(); + string strokeWidth = this.GetPropertyValue("stroke-width"); + if(strokeWidth.Length == 0) strokeWidth = "1px"; + SvgLength strokeWidthLength = new SvgLength(this, "stroke-width", SvgLengthDirection.Viewport, strokeWidth); + if (renderingNode != null) { // Quick-cache - renderingNode.ScreenRegion = GetBRect(0); + renderingNode.ScreenRegion = GetBRect((float)strokeWidthLength.Value); OwnerDocument.Window.Renderer.InvalidateRect(renderingNode.ScreenRegion); } else { - OwnerDocument.Window.Renderer.InvalidateRect(GetBRect(0)); + OwnerDocument.Window.Renderer.InvalidateRect(GetBRect((float)strokeWidthLength.Value)); } } Index: SvgImageElement.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorObjectModel/SharpVectors/dom/svg/Document Structure/SvgImageElement.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SvgImageElement.cs 6 Mar 2005 08:07:04 -0000 1.1 +++ SvgImageElement.cs 20 Nov 2005 20:42:23 -0000 1.2 @@ -323,13 +323,13 @@ doc.LoadXml(testData); SvgImageElement imgElm = doc.GetElementById("theImage") as SvgImageElement; - Assertion.AssertNotNull(imgElm); - Assertion.Assert("IsSvgImage", !imgElm.IsSvgImage); + Assert.IsNotNull(imgElm); + Assert.IsTrue(!imgElm.IsSvgImage, "IsSvgImage"); Bitmap bmp = imgElm.Bitmap; - Assertion.AssertEquals(48, bmp.Width); - Assertion.AssertEquals(48, bmp.Height); + Assert.AreEqual(48, bmp.Width); + Assert.AreEqual(48, bmp.Height); } } #endif |