Commit 4b1ff3d4 authored by Tebjan Halm's avatar Tebjan Halm
Browse files

Merge pull request #89 from erdomke/master

Rendering Improvements and .Net 3.5 Support
parents ba3bc5fc ce8f2a64
......@@ -28,74 +28,79 @@
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SVGViewer));
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.open = new System.Windows.Forms.ToolStripButton();
this.svgImage = new System.Windows.Forms.PictureBox();
this.openSvgFile = new System.Windows.Forms.OpenFileDialog();
this.textBox1 = new System.Windows.Forms.TextBox();
this.toolStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.svgImage)).BeginInit();
this.SuspendLayout();
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.open});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(1060, 25);
this.toolStrip1.TabIndex = 0;
this.toolStrip1.Text = "toolStrip1";
//
// open
//
this.open.Image = ((System.Drawing.Image)(resources.GetObject("open.Image")));
this.open.ImageTransparentColor = System.Drawing.Color.Magenta;
this.open.Name = "open";
this.open.Size = new System.Drawing.Size(53, 22);
this.open.Text = "Open";
this.open.Click += new System.EventHandler(this.open_Click);
//
// svgImage
//
this.svgImage.Dock = System.Windows.Forms.DockStyle.Left;
this.svgImage.Location = new System.Drawing.Point(0, 25);
this.svgImage.Name = "svgImage";
this.svgImage.Size = new System.Drawing.Size(565, 449);
this.svgImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.svgImage.TabIndex = 1;
this.svgImage.TabStop = false;
//
// openSvgFile
//
this.openSvgFile.Filter = "Vector Graphics (*.svg)|*.svg";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(571, 25);
this.textBox1.MaxLength = 327670;
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(477, 446);
this.textBox1.TabIndex = 2;
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
// SVGViewer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1060, 474);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.svgImage);
this.Controls.Add(this.toolStrip1);
this.Name = "SVGViewer";
this.Text = "SVG Viewer";
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.svgImage)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SVGViewer));
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.open = new System.Windows.Forms.ToolStripButton();
this.svgImage = new System.Windows.Forms.PictureBox();
this.openSvgFile = new System.Windows.Forms.OpenFileDialog();
this.textBox1 = new System.Windows.Forms.TextBox();
this.toolStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.svgImage)).BeginInit();
this.SuspendLayout();
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.open});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(1060, 25);
this.toolStrip1.TabIndex = 0;
this.toolStrip1.Text = "toolStrip1";
//
// open
//
this.open.Image = ((System.Drawing.Image)(resources.GetObject("open.Image")));
this.open.ImageTransparentColor = System.Drawing.Color.Magenta;
this.open.Name = "open";
this.open.Size = new System.Drawing.Size(56, 22);
this.open.Text = "Open";
this.open.Click += new System.EventHandler(this.open_Click);
//
// svgImage
//
this.svgImage.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.svgImage.Location = new System.Drawing.Point(0, 25);
this.svgImage.Name = "svgImage";
this.svgImage.Size = new System.Drawing.Size(735, 449);
this.svgImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.svgImage.TabIndex = 1;
this.svgImage.TabStop = false;
//
// openSvgFile
//
this.openSvgFile.Filter = "Vector Graphics (*.svg)|*.svg";
//
// textBox1
//
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox1.Location = new System.Drawing.Point(741, 25);
this.textBox1.MaxLength = 327670;
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(307, 446);
this.textBox1.TabIndex = 2;
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
// SVGViewer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1060, 474);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.svgImage);
this.Controls.Add(this.toolStrip1);
this.Name = "SVGViewer";
this.Text = "SVG Viewer";
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.svgImage)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
......
<svg version="1.1" xmlns:user="urn:user-scripts" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:aras="http://www.aras.com" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<marker id="Triangle" viewBox="0 0 10 6" refX="22" refY="3" markerWidth="10" markerHeight="6" markerUnits="userSpaceOnUse" orient="auto" style="fill:#999;">
<path d="M 0 0 L 10 3 L 0 6 z" />
</marker>
</defs>
<rect style="fill:yellow" x="754" y="282" width="36" height="36" />
<path id="path_A135EC81DDA143DC9D28767B2A41B31D" style="stroke: rgb(52%, 52%, 52%); fill:none; stroke-width: 2px; marker-end: url(#Triangle);" d="M45,212 L109,212" />
<path id="path_6FF994F1BC9F4841950F977A737DDBB8" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M109,212 L246,351" />
<path id="path_E75FD0879CE14583AFBD46320DBCC608" style="stroke: rgb(52%, 52%, 52%); fill:none; stroke-width: 2px; marker-end: url(#Triangle);" d="M109,212 L246,212" />
<path id="path_FA30736F915A4D328A0052667C5F4CF5" style="stroke: rgb(52%, 52%, 52%); fill:none; stroke-width: 2px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M109,212 L246,212" />
<path id="path_98C289D25D164A979817EFAEE13CFE5F" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M246,212 L217,183 L153,183 L109,212" />
<path id="path_72A7FAFD32E048D791AC1BEFCFCEC9D0" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M246,212 L400,212" />
<path id="path_81970D2DC1D04D529CEE9CD6D56A2976" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M246,212 L246,351" />
<path id="path_45C39F121DE043C9897CEA599913FF18" style="stroke: rgb(52%, 52%, 52%); fill:none; stroke-width: 2px; marker-end: url(#Triangle);" d="M246,212 L372,300 L495,300" />
<path id="path_E45EE6187D384A9888495299E8FFA180" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M246,212 L349,258 L480,258 L527,212" />
<path id="path_5E54C1B6B03C412690130BFD4AA11C29" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M246,212 L361,426 L771,426" />
<path id="path_493D6CD66BCB4215B64CA95613A8C4E7" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M246,212 L324,133 L692,133" />
<path id="path_2A4C9573761F4D4082D76D3086C06D14" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M246,212 L351,69" />
<path id="path_F4ADA3A633DA4A2BAC0D1DF37C9E974A" style="stroke: rgb(52%, 52%, 52%); fill:none; stroke-width: 2px; marker-end: url(#Triangle);" d="M495,300 L772,300" />
<path id="path_BD335878BCD949EDA5BD676D82EE95CD" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M495,300 L461,332 L379,332 L246,212" />
<path id="path_31A2E455215649B0955DF48098DBAFB5" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M772,300 L876,300 L969,212" />
<path id="path_07E281627B9B4E6C88C4F416D00FB4D5" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M772,300 L719,353 L610,353" />
<path id="path_16CEC81123CE4437A34A09B2570A513D" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M772,300 L725,392 L396,392 L246,212" />
<path id="path_1D02F0DB7C444FD3A70B9DC2F0D76C1C" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M772,300 L725,392 L396,392 L246,212" />
<path id="path_002289179A4B46EBA27B28323D0A54C7" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M246,212 L217,183 L153,183 L109,212" />
<path id="path_E5E1BAFEC28A4C06BDB27AA52F4FEC6D" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M246,212 L400,212" />
<path id="path_B786DE8A93F34F159B75B7A52D90CE97" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M246,212 L246,351" />
<path id="path_8B5C82191A9D4D2FAD9B987A487C3BA7" style="stroke: rgb(52%, 52%, 52%); fill:none; stroke-width: 2px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M246,212 L372,300 L495,300" />
<path id="path_107E0DAA2EB8485586C479087C1AA226" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M246,212 L349,258 L480,258 L527,212" />
<path id="path_AD1BC5A02C8D477B8169019CAA282F99" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M246,212 L361,426 L771,426" />
<path id="path_5B6980E8BA6D4D4790BADD421037602A" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M246,212 L324,133 L692,133" />
<path id="path_E088B696363F4A6783322F24B4FBAAFB" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M246,212 L351,69" />
<path id="path_4DA4A67EFEF2443FA0A4FE24FA477F11" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M351,69 L448,69 L692,133" />
<path id="path_40867780959E496AA36A6555CD3E33D2" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M351,69 L239,69 L109,212" />
<path id="path_89E0FF64C5734D5CBE0DEF15FCB2FC78" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M400,212 L527,212" />
<path id="path_40ABF0BE79D845A9835EEA8946DC5E13" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M400,212 L368,181 L293,181 L246,212" />
<path id="path_77067CF20C6941088FDC9876FD24F7A6" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);&#xA; opacity: 0;&#xA; " d="M400,212 L368,181 L293,181 L246,212" />
<path id="path_C82DC92658654B059AB8CBA528667ADA" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M500,25 L203,25 L109,212" />
<path id="path_5ABCCBB56C4046859522ED2C9ECD33AD" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M500,25 L692,133" />
<path id="path_B91D6F28E4804A498EFBD5A3D6AF250B" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M527,212 L693,212" />
<path id="path_7F9A959CF641418CBCD4873251B812B3" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M610,353 L548,353 L495,300" />
<path id="path_F284CCEE2AFB4B3BAC3554145B3FD262" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M610,353 L663,300 L772,300" />
<path id="path_2E0294E13A684EBD99F1DB80EDDB9840" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M692,133 L583,25 L500,25" />
<path id="path_A9F0267F5B9744508B9437FE4B0200C4" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M692,133 L749,133 L815,212" />
<path id="path_4CBFE74449654265806D8E904B6EE5BE" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M693,212 L660,180 L560,180 L527,212" />
<path id="path_D87477BFC3BF4F909A04B05F7874846E" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M693,212 L815,212" />
<path id="path_461D5FEE97F646DC8CD142A866D0355F" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M613,469 L202,469 L109,212" />
<path id="path_5AE3619D67904B23B1E93CBD7D1E20D7" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M613,469 L771,426" />
<path id="path_DC4157E0DAE84A46BB953E4BF4510ECE" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M815,212 L969,212" />
<path id="path_330EB66D10C646ADB34B33613E516A4E" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M771,426 L1076,426 L1231,212" />
<path id="path_13D8206671ED47AC920091F58EA1687F" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M771,426 L729,469 L613,469" />
<path id="path_A140353DB1E34B67A51D0CD75D23CBE2" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M771,426 L809,388 L910,388 L969,212" />
<path id="path_6670A0725101421090E5F4CA7624571A" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M969,212 L1132,212" />
<path id="path_FB713A1FF8F9424B8612F8088E7B1F11" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M1132,212 L1231,212" />
<path id="path_9EB82A675F344E598ED07614C26A46EA" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M1132,212 L1098,178 L1004,178 L969,212" />
<path id="path_768FCB23D27C4749B32411A7463D54B1" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M1231,212 L1356,212" />
<path id="path_1BF51A8E49774FDD936814D21809AEC2" style="stroke: rgb(60%, 60%, 60%); fill:none; stroke-width: 1px; marker-end: url(#Triangle);" d="M1231,212 L1167,267 L1025,267 L969,212" />
<ellipse style="fill:white" ry="12" rx="12" cx="45" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_7FCC999FEE5248CDB90824E00D1029BB" height="16" width="16" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/16x16/16x16_arrow_right.gif" x="37" y="204" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_7FCC999FEE5248CDB90824E00D1029BB" x="45" y="238">
<desc>Closed</desc>Start</text>
<ellipse style="fill:white" ry="12" rx="12" cx="109" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_0462DCDBBC314295BD899B481F911C81" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="99" y="201" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_0462DCDBBC314295BD899B481F911C81" x="109" y="238">
<desc>Closed</desc>Submit ECO</text>
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;&#xA; opacity: 0;&#xA; " id="node_label_1F530B42A24F4155B06747CB8F52A8FE" x="246" y="238">
<desc>Closed</desc>MDM Review</text>
<ellipse style="fill:white" ry="12" rx="12" cx="495" cy="300" />
<image preserveAspectRatio="xMidYMid" id="node_img_946BCC8A04FA42EE8917F02183DBD576" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="485" y="289" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_946BCC8A04FA42EE8917F02183DBD576" x="495" y="326">
<desc>Closed</desc>Need Info</text>
<ellipse style="fill:yellow" ry="12" rx="12" cx="772" cy="300" />
<image preserveAspectRatio="xMidYMid" id="node_img_A394CFFCEF61475ABF6F43D4AAA4F278" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="762" y="289" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_A394CFFCEF61475ABF6F43D4AAA4F278" x="772" y="326">
<desc>Active</desc>ECO Plan Approval</text>
<ellipse style="fill:white" ry="12" rx="12" cx="246" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_75B56693C81D461389AA15D5C8017CBF" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="236" y="201" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_75B56693C81D461389AA15D5C8017CBF" x="246" y="238">
<desc>Pending</desc>MDM Review</text>
<ellipse style="fill:white" ry="12" rx="12" cx="351" cy="69" />
<image preserveAspectRatio="xMidYMid" id="node_img_73D771D6831A4F5EA82A766392AB091E" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="341" y="58" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_73D771D6831A4F5EA82A766392AB091E" x="351" y="95">
<desc>Pending</desc>Print/Drawing Update</text>
<ellipse style="fill:white" ry="12" rx="12" cx="400" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_8AF6597A38BB41F288E4EE17F20A8B29" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="390" y="201" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_8AF6597A38BB41F288E4EE17F20A8B29" x="400" y="238">
<desc>Pending</desc>ECO Pre-Approval</text>
<ellipse style="fill:white" ry="12" rx="12" cx="500" cy="25" />
<image preserveAspectRatio="xMidYMid" id="node_img_8476C8E170DC47EA9F05AE2164CABD96" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="490" y="14" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_8476C8E170DC47EA9F05AE2164CABD96" x="500" y="51">
<desc>Pending</desc>Interim Workflow Resolution</text>
<ellipse style="fill:white" ry="12" rx="12" cx="527" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_4517B7B7598A44A1969F30290153FA64" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="517" y="201" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_4517B7B7598A44A1969F30290153FA64" x="527" y="238">
<desc>Pending</desc>Draft Changes</text>
<ellipse style="fill:white" ry="12" rx="12" cx="610" cy="353" />
<image preserveAspectRatio="xMidYMid" id="node_img_7379A1A219DE468FB61D3F1E84C1B042" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="600" y="342" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_7379A1A219DE468FB61D3F1E84C1B042" x="610" y="379">
<desc>Pending</desc>Approval Resolution</text>
<ellipse style="fill:white" ry="12" rx="12" cx="692" cy="133" />
<image preserveAspectRatio="xMidYMid" id="node_img_18F401FCAACC4E8DAC4014EEA576DE51" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="682" y="122" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_18F401FCAACC4E8DAC4014EEA576DE51" x="692" y="159">
<desc>Pending</desc>Change Review</text>
<ellipse style="fill:white" ry="12" rx="12" cx="693" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_014C7DD975FA4E7EB354F9B81E71CB18" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="683" y="201" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_014C7DD975FA4E7EB354F9B81E71CB18" x="693" y="238">
<desc>Pending</desc>Change Review</text>
<ellipse style="fill:white" ry="12" rx="12" cx="613" cy="469" />
<image preserveAspectRatio="xMidYMid" id="node_img_CDE9E46E164645538136D5D120D2593C" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="603" y="458" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_CDE9E46E164645538136D5D120D2593C" x="613" y="495">
<desc>Pending</desc>Pre-Prod Approval Resolution</text>
<ellipse style="fill:white" ry="12" rx="12" cx="815" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_83542AA107564FAABD77DF5C61FBA354" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="805" y="201" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_83542AA107564FAABD77DF5C61FBA354" x="815" y="238">
<desc>Pending</desc>Impl. Plan Review</text>
<ellipse style="fill:white" ry="12" rx="12" cx="771" cy="426" />
<image preserveAspectRatio="xMidYMid" id="node_img_64D911B1C1AD41208373D9AF319AB38D" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="761" y="415" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_64D911B1C1AD41208373D9AF319AB38D" x="771" y="452">
<desc>Pending</desc>Pre-Production Approval</text>
<ellipse style="fill:white" ry="12" rx="12" cx="969" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_43578966BE674CC9A7C0D54FE88E0C91" height="16" width="16" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/customer/16x16 Icons 1/icon_clock.gif" x="961" y="204" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_43578966BE674CC9A7C0D54FE88E0C91" x="969" y="238">
<desc>Pending</desc>Effectivity Wait</text>
<ellipse style="fill:white" ry="12" rx="12" cx="1132" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_D21E5FAE6F784BB19EEE40C334473CBB" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="1122" y="201" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_D21E5FAE6F784BB19EEE40C334473CBB" x="1132" y="238">
<desc>Pending</desc>Impl. Approval</text>
<ellipse style="fill:white" ry="12" rx="12" cx="1231" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_DB1C8B95B26C4069ACC03F0E3D42C249" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="1221" y="201" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_DB1C8B95B26C4069ACC03F0E3D42C249" x="1231" y="238">
<desc>Pending</desc>Impl. Approved</text>
<ellipse style="fill:white" ry="12" rx="12" cx="246" cy="351" />
<image preserveAspectRatio="xMidYMid" id="node_img_67A00DAAD58D4115A63B45049D2B3986" height="22" width="20" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/Icons/20x20/20x22_gray_ball.gif" x="236" y="340" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_67A00DAAD58D4115A63B45049D2B3986" x="246" y="377">
<desc>Pending</desc>Cancel</text>
<ellipse style="fill:white" ry="12" rx="12" cx="1356" cy="212" />
<image preserveAspectRatio="xMidYMid" id="node_img_CD08C79BB931412A8C31745DF6A4910A" height="16" width="16" xlink:href="http://ct.gentex.com/gentexinnovator/Client/images/customer/16x16 Icons 1/page_favourites.gif" x="1348" y="204" />
<text text-anchor="middle" style="font-family:Verdana;font-size:8pt;fill:Blue;" id="node_label_CD08C79BB931412A8C31745DF6A4910A" x="1356" y="238">
<desc>Pending</desc>Close Change</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_A135EC81DDA143DC9D28767B2A41B31D" x="51" y="208">Go</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_6FF994F1BC9F4841950F977A737DDBB8" x="135" y="278">Cancel ECO</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_E75FD0879CE14583AFBD46320DBCC608" x="132" y="209">Submit</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_98C289D25D164A979817EFAEE13CFE5F" x="162" y="193">Unsubmit</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_72A7FAFD32E048D791AC1BEFCFCEC9D0" x="268" y="209">iLink - Pre-Approval</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_81970D2DC1D04D529CEE9CD6D56A2976" x="204" y="285">Cancel ECO</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_45C39F121DE043C9897CEA599913FF18" x="368" y="296">Legacy Workflow</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_E45EE6187D384A9888495299E8FFA180" x="350" y="255">iLink - Pre-Approved</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_5E54C1B6B03C412690130BFD4AA11C29" x="363" y="422">Pre-Production Workflow</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_493D6CD66BCB4215B64CA95613A8C4E7" x="324" y="143">Interim Workflow (Approval)</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_2A4C9573761F4D4082D76D3086C06D14" x="226" y="113">Interim Workflow (Prints)</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_F4ADA3A633DA4A2BAC0D1DF37C9E974A" x="508" y="296">Added Info</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_BD335878BCD949EDA5BD676D82EE95CD" x="403" y="341">Re-Review</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_31A2E455215649B0955DF48098DBAFB5" x="783" y="297">Approve ECO</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_07E281627B9B4E6C88C4F416D00FB4D5" x="634" y="362">Need more info</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_16CEC81123CE4437A34A09B2570A513D" x="757" y="342">Reject</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_4DA4A67EFEF2443FA0A4FE24FA477F11" x="358" y="65">Prints Updated</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_40867780959E496AA36A6555CD3E33D2" x="282" y="66">Unsubmit</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_89E0FF64C5734D5CBE0DEF15FCB2FC78" x="414" y="208">Approve</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_40ABF0BE79D845A9835EEA8946DC5E13" x="333" y="190">Reject</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_C82DC92658654B059AB8CBA528667ADA" x="429" y="21">Unsubmit</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_5ABCCBB56C4046859522ED2C9ECD33AD" x="513" y="68">Redo Approval</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_B91D6F28E4804A498EFBD5A3D6AF250B" x="543" y="208">Submit for Review</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_7F9A959CF641418CBCD4873251B812B3" x="496" y="364">Repeat Need Info</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_F284CCEE2AFB4B3BAC3554145B3FD262" x="601" y="323">Repeat Approval</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_2E0294E13A684EBD99F1DB80EDDB9840" x="664" y="104">Reject</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_A9F0267F5B9744508B9437FE4B0200C4" x="702" y="128">Approve</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_4CBFE74449654265806D8E904B6EE5BE" x="619" y="190">Rework</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_D87477BFC3BF4F909A04B05F7874846E" x="706" y="207">Approve</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_461D5FEE97F646DC8CD142A866D0355F" x="544" y="479">Unsubmit</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_5AE3619D67904B23B1E93CBD7D1E20D7" x="608" y="445">Redo Approval</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_DC4157E0DAE84A46BB953E4BF4510ECE" x="825" y="207">Approve Plan</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_330EB66D10C646ADB34B33613E516A4E" x="788" y="421">Approve &amp; Implement</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_13D8206671ED47AC920091F58EA1687F" x="741" y="467">Reject ECO</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_A140353DB1E34B67A51D0CD75D23CBE2" x="810" y="384">Approve &amp; Wait</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_6670A0725101421090E5F4CA7624571A" x="989" y="209">Req. Impl. Approval</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_FB713A1FF8F9424B8612F8088E7B1F11" x="1144" y="208">Ready</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_9EB82A675F344E598ED07614C26A46EA" x="1043" y="188">Not Ready</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_768FCB23D27C4749B32411A7463D54B1" x="1242" y="208">Fully Impl/Close</text>
<text style="font-family: Verdana;font-size:8pt; fill:Black;" text-anchor="start" id="path_label_1BF51A8E49774FDD936814D21809AEC2" x="1086" y="277">Continue Wait</text>
</svg>
......@@ -3,6 +3,9 @@ using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.ComponentModel;
using Svg.DataTypes;
using System.Text.RegularExpressions;
using System.Linq;
namespace Svg
{
......@@ -151,5 +154,159 @@ namespace Svg
get { return (this.Attributes["opacity"] == null) ? 1.0f : (float)this.Attributes["opacity"]; }
set { this.Attributes["opacity"] = FixOpacityValue(value); }
}
/// <summary>
/// Indicates which font family is to be used to render the text.
/// </summary>
[SvgAttribute("font-family")]
public virtual string FontFamily
{
get { return this.Attributes["font-family"] as string; }
set
{
this.Attributes["font-family"] = value;
this.IsPathDirty = true;
}
}
/// <summary>
/// Refers to the size of the font from baseline to baseline when multiple lines of text are set solid in a multiline layout environment.
/// </summary>
[SvgAttribute("font-size")]
public virtual SvgUnit FontSize
{
get { return (this.Attributes["font-size"] == null) ? SvgUnit.Empty : (SvgUnit)this.Attributes["font-size"]; }
set { this.Attributes["font-size"] = value; this.IsPathDirty = true; }
}
public SvgUnit GetInheritedFontSize()
{
var fontSizeElement = (from e in this.ParentsAndSelf.OfType<SvgVisualElement>()
where e.FontSize != SvgUnit.Empty && e.FontSize != SvgUnit.None
select e).FirstOrDefault();
return (fontSizeElement == null ? SvgUnit.None : fontSizeElement.FontSize);
}
/// <summary>
/// Refers to the boldness of the font.
/// </summary>
[SvgAttribute("font-style")]
public virtual SvgFontStyle FontStyle
{
get { return (this.Attributes["font-style"] == null) ? SvgFontStyle.inherit : (SvgFontStyle)this.Attributes["font-style"]; }
set { this.Attributes["font-style"] = value; this.IsPathDirty = true; }
}
/// <summary>
/// Refers to the boldness of the font.
/// </summary>
[SvgAttribute("font-variant")]
public virtual SvgFontVariant FontVariant
{
get { return (this.Attributes["font-variant"] == null) ? SvgFontVariant.inherit : (SvgFontVariant)this.Attributes["font-variant"]; }
set { this.Attributes["font-variant"] = value; this.IsPathDirty = true; }
}
/// <summary>
/// Refers to the boldness of the font.
/// </summary>
[SvgAttribute("font-weight")]
public virtual SvgFontWeight FontWeight
{
get { return (this.Attributes["font-weight"] == null) ? SvgFontWeight.inherit : (SvgFontWeight)this.Attributes["font-weight"]; }
set { this.Attributes["font-weight"] = value; this.IsPathDirty = true; }
}
private enum FontParseState
{
fontStyle,
fontVariant,
fontWeight,
fontSize,
fontFamilyNext,
fontFamilyCurr
}
/// <summary>
/// Set all font information.
/// </summary>
[SvgAttribute("font")]
public virtual string Font
{
get { return (this.Attributes["font"] == null ? "" : this.Attributes["font"] as string); }
set
{
var state = FontParseState.fontStyle;
var parts = value.Split(' ');
SvgFontStyle fontStyle;
SvgFontVariant fontVariant;
SvgFontWeight fontWeight;
SvgUnit fontSize;
bool success;
string[] sizes;
string part;
for (int i = 0; i < parts.Length; i++)
{
part = parts[i];
success = false;
while (!success)
{
switch (state)
{
case FontParseState.fontStyle:
success = Enums.TryParse<SvgFontStyle>(part, out fontStyle);
if (success) this.FontStyle = fontStyle;
state++;
break;
case FontParseState.fontVariant:
success = Enums.TryParse<SvgFontVariant>(part, out fontVariant);
if (success) this.FontVariant = fontVariant;
state++;
break;
case FontParseState.fontWeight:
success = Enums.TryParse<SvgFontWeight>(part, out fontWeight);
if (success) this.FontWeight = fontWeight;
state++;
break;
case FontParseState.fontSize:
sizes = part.Split('/');
try
{
fontSize = (SvgUnit)(new SvgUnitConverter().ConvertFromInvariantString(sizes[0]));
success = true;
this.FontSize = fontSize;
}
catch { }
state++;
break;
case FontParseState.fontFamilyNext:
state++;
success = true;
break;
}
}
switch (state)
{
case FontParseState.fontFamilyNext:
this.FontFamily = string.Join(" ", parts, i + 1, parts.Length - (i + 1));
i = int.MaxValue - 2;
break;
case FontParseState.fontFamilyCurr:
this.FontFamily = string.Join(" ", parts, i, parts.Length - (i));
i = int.MaxValue - 2;
break;
}
}
this.Attributes["font"] = value;
this.IsPathDirty = true;
}
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Svg
{
public enum SvgFontStyle
{
normal,
italic,
oblique,
inherit
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
namespace Svg.DataTypes
{
[TypeConverter(typeof(SvgFontVariantConverter))]
public enum SvgFontVariant
{
normal,
smallcaps,
inherit
}
}
......@@ -2,14 +2,26 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
namespace Svg.DataTypes
namespace Svg
{
public enum SvgFontWeight
{
normal,
bold
}
[TypeConverter(typeof(SvgFontWeightConverter))]
public enum SvgFontWeight
{
inherit,
normal,
bold,
bolder,
lighter,
w100,
w200,
w300,
w400, // same as normal
w500,
w600,
w700, // same as bold
w800,
w900
}
}
......@@ -102,8 +102,16 @@ namespace Svg
switch (this.Type)
{
case SvgUnitType.Em:
float points = (float)(this.Value * 9);
_deviceValue = (points / 72) * ppi;
var visualElem = boundable as SvgVisualElement;
if (visualElem == null)
{
float points = (float)(this.Value * 9);
_deviceValue = (points / 72) * ppi;
}
else
{
_deviceValue = this.Value * visualElem.GetInheritedFontSize().ToDeviceValue(boundable);
}
break;
case SvgUnitType.Centimeter:
_deviceValue = (float)((this.Value / cmInInch) * ppi);
......
......@@ -45,6 +45,7 @@ namespace Svg
{
if (value is string)
{
if (string.Compare(((string)value).Trim(), "none", StringComparison.InvariantCultureIgnoreCase) == 0) return null;
string[] points = ((string)value).Trim().Split(new char[] { ',', ' ', '\r', '\n', '\t' }, StringSplitOptions.RemoveEmptyEntries);
SvgUnitCollection units = new SvgUnitCollection();
......
......@@ -23,13 +23,6 @@ namespace Svg
throw new ArgumentOutOfRangeException("value must be a string.");
}
//support exponents (the SVG that comes back from IE may be an exponent ugh!!!)
if ((value as string).Contains("e"))
{
var d = Decimal.Parse((string)value, System.Globalization.NumberStyles.Float);
value = d.ToString();
}
// http://www.w3.org/TR/CSS21/syndata.html#values
// http://www.w3.org/TR/SVG11/coords.html#Units
......@@ -41,7 +34,8 @@ namespace Svg
for (int i = 0; i < unit.Length; i++)
{
if (char.IsLetter(unit[i]) || unit[i] == '%')
// If the character is a percent sign or a letter which is not an exponent 'e'
if (unit[i] == '%' || (char.IsLetter(unit[i]) && !(unit[i] == 'e' && i < unit.Length - 1 && !char.IsLetter(unit[i + 1]))))
{
identifierIndex = i;
break;
......
......@@ -9,31 +9,20 @@ namespace Svg
[SvgElement("desc")]
public class SvgDescription : SvgElement
{
private string _text;
public string Text
public override string ToString()
{
get { return this._text; }
set { this._text = value; }
return this.Content;
}
public override string ToString()
public override SvgElement DeepCopy()
{
return this.Text;
return DeepCopy<SvgDescription>();
}
public override SvgElement DeepCopy()
{
return DeepCopy<SvgDescription>();
}
public override SvgElement DeepCopy<T>()
{
var newObj = base.DeepCopy<T>() as SvgDescription;
newObj.Text = this.Text;
return newObj;
}
public override SvgElement DeepCopy<T>()
{
var newObj = base.DeepCopy<T>() as SvgDescription;
return newObj;
}
}
}
\ No newline at end of file
......@@ -7,17 +7,22 @@ namespace Svg
{
[SvgElement("title")]
public class SvgTitle : SvgElement
{
public override SvgElement DeepCopy()
{
{
public override string ToString()
{
return this.Content;
}
public override SvgElement DeepCopy()
{
return DeepCopy<SvgTitle>();
}
}
public override SvgElement DeepCopy<T>()
{
public override SvgElement DeepCopy<T>()
{
var newObj = base.DeepCopy<T>() as SvgTitle;
return newObj;
}
return newObj;
}
}
}
\ No newline at end of file
......@@ -13,7 +13,7 @@ namespace Svg
{
private Uri _referencedElement;
[SvgAttribute("xlink:href")]
[SvgAttribute("href", SvgAttributeAttribute.XLinkNamespace)]
public virtual Uri ReferencedElement
{
get { return this._referencedElement; }
......@@ -49,8 +49,8 @@ namespace Svg
/// </summary>
public SvgUse()
{
this.X = 0;
this.Y = 0;
this.X = 0;
this.Y = 0;
}
public override System.Drawing.Drawing2D.GraphicsPath Path
......@@ -69,16 +69,16 @@ namespace Svg
get { return new System.Drawing.RectangleF(); }
}
// public override SvgElementCollection Children
// {
// get
// {
// SvgElement element = this.OwnerDocument.IdManager.GetElementById(this.ReferencedElement);
// SvgElementCollection elements = new SvgElementCollection(this, true);
// elements.Add(element);
// return elements;
// }
// }
// public override SvgElementCollection Children
// {
// get
// {
// SvgElement element = this.OwnerDocument.IdManager.GetElementById(this.ReferencedElement);
// SvgElementCollection elements = new SvgElementCollection(this, true);
// elements.Add(element);
// return elements;
// }
// }
protected override void Render(SvgRenderer renderer)
{
......@@ -99,20 +99,20 @@ namespace Svg
}
public override SvgElement DeepCopy()
{
return DeepCopy<SvgUse>();
}
public override SvgElement DeepCopy()
{
return DeepCopy<SvgUse>();
}
public override SvgElement DeepCopy<T>()
{
var newObj = base.DeepCopy<T>() as SvgUse;
newObj.ReferencedElement = this.ReferencedElement;
newObj.X = this.X;
newObj.Y = this.Y;
public override SvgElement DeepCopy<T>()
{
var newObj = base.DeepCopy<T>() as SvgUse;
newObj.ReferencedElement = this.ReferencedElement;
newObj.X = this.X;
newObj.Y = this.Y;
return newObj;
}
return newObj;
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace Svg
{
public static class Extensions
{
public static IEnumerable<SvgElement> Descendants<T>(this IEnumerable<T> source) where T : SvgElement
{
if (source == null) throw new ArgumentNullException("source");
return GetDescendants<T>(source, false);
}
private static IEnumerable<SvgElement> GetAncestors<T>(IEnumerable<T> source, bool self) where T : SvgElement
{
foreach (var start in source)
{
if (start != null)
{
for (var elem = (self ? start : start.Parent) as SvgElement; elem != null; elem = (elem.Parent as SvgElement))
{
yield return elem;
}
}
}
yield break;
}
private static IEnumerable<SvgElement> GetDescendants<T>(IEnumerable<T> source, bool self) where T : SvgElement
{
var positons = new Stack<int>();
int currPos;
SvgElement currParent;
foreach (var start in source)
{
if (start != null)
{
if (self) yield return start;
positons.Push(0);
currParent = start;
while (positons.Count > 0)
{
currPos = positons.Pop();
if (currPos < currParent.Children.Count)
{
yield return currParent.Children[currPos];
currParent = currParent.Children[currPos];
positons.Push(currPos + 1);
positons.Push(0);
}
else
{
currParent = currParent.Parent;
}
}
}
}
yield break;
}
}
}
\ No newline at end of file
......@@ -14,10 +14,10 @@ namespace Svg.FilterEffects
[SvgElement("feGaussianBlur")]
public class SvgGaussianBlur : SvgFilterPrimitive
{
private int _stdDeviation;
private BlurType _blurType;
private int[] _kernel;
private float _stdDeviation;
private BlurType _blurType;
private int[] _kernel;
private int _kernelSum;
private int[,] _multable;
......@@ -26,12 +26,13 @@ namespace Svg.FilterEffects
{
}
public SvgGaussianBlur(int stdDeviation)
public SvgGaussianBlur(float stdDeviation)
: this(stdDeviation, BlurType.Both)
{
}
public SvgGaussianBlur(int stdDeviation, BlurType blurType) : base()
public SvgGaussianBlur(float stdDeviation, BlurType blurType)
: base()
{
_stdDeviation = stdDeviation;
_blurType = blurType;
......@@ -42,13 +43,13 @@ namespace Svg.FilterEffects
private void PreCalculate()
{
int sz = _stdDeviation * 2 + 1;
int sz = (int)(_stdDeviation * 2 + 1);
_kernel = new int[sz];
_multable = new int[sz, 256];
for (int i = 1; i <= _stdDeviation; i++)
{
int szi = _stdDeviation - i;
int szj = _stdDeviation + i;
int szi = (int)(_stdDeviation - i);
int szj = (int)(_stdDeviation + i);
_kernel[szj] = _kernel[szi] = (szi + 1) * (szi + 1);
_kernelSum += (_kernel[szj] + _kernel[szi]);
for (int j = 0; j < 256; j++)
......@@ -56,11 +57,11 @@ namespace Svg.FilterEffects
_multable[szj, j] = _multable[szi, j] = _kernel[szj] * j;
}
}
_kernel[_stdDeviation] = (_stdDeviation + 1) * (_stdDeviation + 1);
_kernelSum += _kernel[_stdDeviation];
_kernel[(int)_stdDeviation] = (int)((_stdDeviation + 1) * (_stdDeviation + 1));
_kernelSum += _kernel[(int)_stdDeviation];
for (int j = 0; j < 256; j++)
{
_multable[_stdDeviation, j] = _kernel[_stdDeviation] * j;
_multable[(int)_stdDeviation, j] = _kernel[(int)_stdDeviation] * j;
}
}
......@@ -104,7 +105,7 @@ namespace Svg.FilterEffects
for (int i = 0; i < pixelCount; i++)
{
bsum = gsum = rsum = asum = 0;
read = i - _stdDeviation;
read = (int)(i - _stdDeviation);
for (int z = 0; z < _kernel.Length; z++)
{
if (read < start)
......@@ -156,7 +157,7 @@ namespace Svg.FilterEffects
index = 0;
for (int i = 0; i < src.Height; i++)
{
int y = i - _stdDeviation;
int y = (int)(i - _stdDeviation);
start = y * src.Width;
for (int j = 0; j < src.Width; j++)
{
......@@ -219,16 +220,16 @@ namespace Svg.FilterEffects
}
}
/// <summary>
/// Gets or sets the radius of the blur (only allows for one value - not the two specified in the SVG Spec)
/// </summary>
[SvgAttribute("stdDeviation")]
public int StdDeviation
/// <summary>
/// Gets or sets the radius of the blur (only allows for one value - not the two specified in the SVG Spec)
/// </summary>
[SvgAttribute("stdDeviation")]
public float StdDeviation
{
get { return _stdDeviation; }
set
{
if (value < 1)
if (value <= 0)
{
throw new InvalidOperationException("Radius must be greater then 0");
}
......@@ -248,27 +249,27 @@ namespace Svg.FilterEffects
}
public override Bitmap Process()
{
//Todo
return null;
}
public override Bitmap Process()
{
//Todo
return null;
}
public override SvgElement DeepCopy()
{
return DeepCopy<SvgGaussianBlur>();
}
public override SvgElement DeepCopy()
{
return DeepCopy<SvgGaussianBlur>();
}
public override SvgElement DeepCopy<T>()
{
var newObj = base.DeepCopy<T>() as SvgGaussianBlur;
newObj.StdDeviation = this.StdDeviation;
newObj.BlurType = this.BlurType;
return newObj;
}
public override SvgElement DeepCopy<T>()
{
var newObj = base.DeepCopy<T>() as SvgGaussianBlur;
newObj.StdDeviation = this.StdDeviation;
newObj.BlurType = this.BlurType;
return newObj;
}
}
}
\ No newline at end of file
......@@ -5,7 +5,6 @@ using System.Globalization;
namespace Svg
{
//just overrrides canconvert and returns true
public class BaseConverter : TypeConverter
{
......@@ -120,4 +119,77 @@ namespace Svg
public sealed class SvgMarkerUnitsConverter : EnumBaseConverter<SvgMarkerUnits>
{
}
public sealed class SvgFontVariantConverter : EnumBaseConverter<SvgFontVariant>
{
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
if (value == "small-caps") return SvgFontVariant.smallcaps;
return base.ConvertFrom(context, culture, value);
}
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string) && value is SvgFontVariant && (SvgFontVariant)value == SvgFontVariant.smallcaps)
{
return "small-caps";
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
public sealed class SvgFontWeightConverter : EnumBaseConverter<SvgFontWeight>
{
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
if (value is string)
{
switch ((string)value)
{
case "100": return SvgFontWeight.w100;
case "200": return SvgFontWeight.w200;
case "300": return SvgFontWeight.w300;
case "400": return SvgFontWeight.w400;
case "500": return SvgFontWeight.w500;
case "600": return SvgFontWeight.w600;
case "700": return SvgFontWeight.w700;
case "800": return SvgFontWeight.w800;
case "900": return SvgFontWeight.w900;
}
}
return base.ConvertFrom(context, culture, value);
}
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string) && value is SvgFontWeight)
{
switch ((SvgFontWeight)value)
{
case SvgFontWeight.w100: return "100";
case SvgFontWeight.w200: return "200";
case SvgFontWeight.w300: return "300";
case SvgFontWeight.w400: return "400";
case SvgFontWeight.w500: return "500";
case SvgFontWeight.w600: return "600";
case SvgFontWeight.w700: return "700";
case SvgFontWeight.w800: return "800";
case SvgFontWeight.w900: return "900";
}
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
public static class Enums
{
public static bool TryParse<TEnum>(string value, out TEnum result) where TEnum : struct, IConvertible
{
var retValue = value == null ?
false :
Enum.IsDefined(typeof(TEnum), value);
result = retValue ?
(TEnum)Enum.Parse(typeof(TEnum), value) :
default(TEnum);
return retValue;
}
}
}
......@@ -57,9 +57,9 @@ namespace Svg
{
alphastring = "0" + alphastring;
}
var alphaDecimal = decimal.Parse(alphastring);
if(alphaDecimal <= 1)
{
alphaValue = (int)(alphaDecimal * 255);
......@@ -69,7 +69,18 @@ namespace Svg
alphaValue = (int)alphaDecimal;
}
}
Color colorpart = System.Drawing.Color.FromArgb(alphaValue, int.Parse(values[0]), int.Parse(values[1]), int.Parse(values[2]));
Color colorpart;
if (values[0].Trim().EndsWith("%"))
{
colorpart = System.Drawing.Color.FromArgb(alphaValue, (int)(255 * float.Parse(values[0].Trim().TrimEnd('%')) / 100f),
(int)(255 * float.Parse(values[1].Trim().TrimEnd('%')) / 100f),
(int)(255 * float.Parse(values[2].Trim().TrimEnd('%')) / 100f));
}
else
{
colorpart = System.Drawing.Color.FromArgb(alphaValue, int.Parse(values[0]), int.Parse(values[1]), int.Parse(values[2]));
}
return colorpart;
}
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Svg
{
/// <summary>
/// A wrapper for a paint server which isn't defined currently in the parse process, but
/// should be defined by the time the image needs to render.
/// </summary>
public class SvgDeferredPaintServer : SvgPaintServer
{
private bool _serverLoaded = false;
private SvgPaintServer _concreteServer;
public SvgDocument Document { get; set; }
public string DeferredId { get; set; }
public SvgDeferredPaintServer() { }
public SvgDeferredPaintServer(SvgDocument document, string id)
{
this.Document = document;
this.DeferredId = id;
}
private void EnsureServer()
{
if (!_serverLoaded)
{
_concreteServer = this.Document.IdManager.GetElementById(this.DeferredId) as SvgPaintServer;
_serverLoaded = true;
}
}
public override System.Drawing.Brush GetBrush(SvgVisualElement styleOwner, float opacity)
{
EnsureServer();
return _concreteServer.GetBrush(styleOwner, opacity);
}
public override SvgElement DeepCopy()
{
return DeepCopy<SvgDeferredPaintServer>();
}
public override SvgElement DeepCopy<T>()
{
var newObj = base.DeepCopy<T>() as SvgDeferredPaintServer;
newObj.Document = this.Document;
newObj.DeferredId = this.DeferredId;
return newObj;
}
public override bool Equals(object obj)
{
var other = obj as SvgDeferredPaintServer;
if (other == null)
return false;
return this.Document == other.Document && this.DeferredId == other.DeferredId;
}
public override int GetHashCode()
{
if (this.Document == null || this.DeferredId == null) return 0;
return this.Document.GetHashCode() ^ this.DeferredId.GetHashCode();
}
public override string ToString()
{
return (_serverLoaded ? _serverLoaded.ToString() : string.Format("deferred: {0}", this.DeferredId));
}
public static T TryGet<T>(SvgPaintServer server) where T : SvgPaintServer
{
var deferred = server as SvgDeferredPaintServer;
if (deferred == null)
{
return server as T;
}
else
{
return deferred._concreteServer as T;
}
}
}
}
\ No newline at end of file
......@@ -13,7 +13,7 @@ namespace Svg
{
private SvgCoordinateUnits _gradientUnits;
private SvgGradientSpreadMethod _spreadMethod;
private SvgGradientServer _inheritGradient;
private SvgPaintServer _inheritGradient;
private List<SvgGradientStop> _stops;
/// <summary>
......@@ -89,13 +89,12 @@ namespace Svg
/// Gets or sets another gradient fill from which to inherit the stops from.
/// </summary>
[SvgAttribute("href")]
public SvgGradientServer InheritGradient
public SvgPaintServer InheritGradient
{
get { return this._inheritGradient; }
set
{
this._inheritGradient = value;
this.InheritStops();
}
}
......@@ -220,14 +219,12 @@ namespace Svg
return blend;
}
/// <summary>
// If this gradient contains no stops then it will search any inherited gradients for stops.
/// </summary>
protected virtual void InheritStops()
protected void LoadStops()
{
if (this.Stops.Count == 0 && this.InheritGradient != null)
var core = SvgDeferredPaintServer.TryGet<SvgGradientServer>(_inheritGradient);
if (this.Stops.Count == 0 && core != null)
{
_stops.AddRange(this.InheritGradient.Stops);
_stops.AddRange(core.Stops);
}
}
......
......@@ -81,6 +81,7 @@ namespace Svg
public override Brush GetBrush(SvgVisualElement renderingElement, float opacity)
{
LoadStops();
if (IsInvalid)
{
return null;
......@@ -97,8 +98,8 @@ namespace Svg
if (NeedToExpandGradient(renderingElement, specifiedStart, specifiedEnd))
{
var expansion = ExpandGradient(renderingElement, specifiedStart, specifiedEnd);
effectiveStart = expansion.Item1;
effectiveEnd = expansion.Item2;
effectiveStart = expansion.StartPoint;
effectiveEnd = expansion.EndPoint;
}
return new LinearGradientBrush(effectiveStart, effectiveEnd, Color.Transparent, Color.Transparent)
......@@ -123,12 +124,24 @@ namespace Svg
return SpreadMethod == SvgGradientSpreadMethod.Pad && (boundable.Bounds.Contains(specifiedStart) || boundable.Bounds.Contains(specifiedEnd));
}
private Tuple<PointF, PointF> ExpandGradient(ISvgBoundable boundable, PointF specifiedStart, PointF specifiedEnd)
public struct GradientPoints
{
public PointF StartPoint;
public PointF EndPoint;
public GradientPoints(PointF startPoint, PointF endPoint)
{
this.StartPoint = startPoint;
this.EndPoint = endPoint;
}
}
private GradientPoints ExpandGradient(ISvgBoundable boundable, PointF specifiedStart, PointF specifiedEnd)
{
if (!NeedToExpandGradient(boundable, specifiedStart, specifiedEnd))
{
Debug.Fail("Unexpectedly expanding gradient when not needed!");
return new Tuple<PointF, PointF>(specifiedStart, specifiedEnd);
return new GradientPoints(specifiedStart, specifiedEnd);
}
var specifiedLength = CalculateDistance(specifiedStart, specifiedEnd);
......@@ -158,7 +171,7 @@ namespace Svg
effectiveEnd = MovePointAlongVector(effectiveEnd, specifiedUnitVector, 1);
}
return new Tuple<PointF, PointF>(effectiveStart, effectiveEnd);
return new GradientPoints(effectiveStart, effectiveEnd);
}
private ColorBlend CalculateColorBlend(SvgVisualElement owner, float opacity, PointF specifiedStart, PointF effectiveStart, PointF specifiedEnd, PointF effectiveEnd)
......@@ -180,11 +193,11 @@ namespace Svg
for (var i = 0; i < colorBlend.Positions.Length; i++)
{
var originalPoint = MovePointAlongVector(specifiedStart, specifiedUnitVector, (float) specifiedLength * colorBlend.Positions[i]);
var originalPoint = MovePointAlongVector(specifiedStart, specifiedUnitVector, (float)specifiedLength * colorBlend.Positions[i]);
var distanceFromEffectiveStart = CalculateDistance(effectiveStart, originalPoint);
colorBlend.Positions[i] = (float) Math.Max(0F, Math.Min((distanceFromEffectiveStart / effectiveLength), 1.0F));
colorBlend.Positions[i] = (float)Math.Round(Math.Max(0F, Math.Min((distanceFromEffectiveStart / effectiveLength), 1.0F)), 5);
}
if (startDelta > 0)
......@@ -240,7 +253,7 @@ namespace Svg
private float Y1
{
get;
get;
set;
}
......
......@@ -38,7 +38,18 @@ namespace Svg
{
return (SvgPaintServer)document.IdManager.GetElementById(value);
}
else // Otherwise try and parse as colour
else if (value.StartsWith("#")) // Otherwise try and parse as colour
{
try
{
return new SvgColourServer((Color)_colourConverter.ConvertFrom(value.Trim()));
}
catch
{
return new SvgDeferredPaintServer(document, value);
}
}
else
{
return new SvgColourServer((Color)_colourConverter.ConvertFrom(value.Trim()));
}
......@@ -49,7 +60,7 @@ namespace Svg
if (value is string)
{
var s = (string) value;
if(String.Equals( s.Trim(), "none", StringComparison.OrdinalIgnoreCase) || string.IsNullOrWhiteSpace(s))
if (String.Equals(s.Trim(), "none", StringComparison.OrdinalIgnoreCase) || string.IsNullOrEmpty(s) || s.Trim().Length < 1)
return SvgPaintServer.None;
else
return SvgPaintServerFactory.Create(s, (SvgDocument)context);
......@@ -105,4 +116,4 @@ namespace Svg
return base.ConvertTo(context, culture, value, destinationType);
}
}
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment