1
1
mirror of https://github.com/dgis/xsddiagram.git synced 2024-08-17 06:20:23 +03:00

Fix SVG page size.

This commit is contained in:
dgis 2016-03-01 19:05:09 +01:00
parent eec1003f76
commit 92a3502534
6 changed files with 13 additions and 5 deletions

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]

View File

@ -1,6 +1,6 @@
XSD Diagram is a free xml schema definition diagram viewer (http://regis.cosnier.free.fr).
Version 1.0 Copyright (c) 2006-2016 Regis Cosnier, All Rights Reserved.
Version 1.1 Copyright (c) 2006-2016 Regis Cosnier, All Rights Reserved.
This program is free software and may be distributed
according to the terms of the GNU General Public License (GPL).
@ -121,6 +121,9 @@ TODO LIST:
CHANGES:
version 1.1 (Not released yet)
- Fix SVG page size.
version 1.0 (2016-02-28)
- Add the documentation in the diagram.
- Add a close entry in the File menu.

Binary file not shown.

Binary file not shown.

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -24,6 +24,7 @@ namespace XSDDiagram.Rendering
private TextWriter _writer;
private Graphics _graphics;
private Rectangle _boundingBox;
private int xsdDocCounter = 0;
@ -84,7 +85,10 @@ namespace XSDDiagram.Rendering
_writer.WriteLine(@"<?xml version=""1.0"" standalone=""no""?>");
_writer.WriteLine(@"<!DOCTYPE svg PUBLIC ""-//W3C//DTD SVG 1.1//EN"" ""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"">");
_writer.WriteLine(@"<svg width=""100%"" height=""100%"" version=""1.1"" xmlns=""http://www.w3.org/2000/svg"">");
if(_boundingBox.Width > 0 && _boundingBox.Height > 0)
_writer.WriteLine("<svg width=\"{0}\" height=\"{1}\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">", _boundingBox.Width, _boundingBox.Height);
else
_writer.WriteLine(@"<svg width=""100%"" height=""100%"" version=""1.1"" xmlns=""http://www.w3.org/2000/svg"">");
}
public override void EndItemsRender()
@ -94,6 +98,7 @@ namespace XSDDiagram.Rendering
public override void Render(Diagram diagram)
{
_boundingBox = diagram.ScaleRectangle(diagram.BoundingBox);
this.BeginItemsRender();
foreach (DiagramItem element in diagram.RootElements)