From a4dedc56a34f4c4bc5ae9157b1d5c68031afc579 Mon Sep 17 00:00:00 2001 From: codeimp Date: Wed, 6 May 2009 20:41:12 +0000 Subject: [PATCH] - Sector splitting fix - Adjusted vertical line spacing to text in script editor for readability --- Source/Core/Controls/ScintillaControl.cs | 32 ++++++++++++++ Source/Core/Controls/ScriptEditorControl.cs | 2 + Source/Core/Map/MapSet.cs | 46 ++++++++++++--------- 3 files changed, 61 insertions(+), 19 deletions(-) diff --git a/Source/Core/Controls/ScintillaControl.cs b/Source/Core/Controls/ScintillaControl.cs index 4e670ebc..599adc95 100644 --- a/Source/Core/Controls/ScintillaControl.cs +++ b/Source/Core/Controls/ScintillaControl.cs @@ -328,6 +328,38 @@ namespace CodeImp.DoomBuilder.Controls } } + /// + /// Spacing above a line + /// + public int ExtraAscent + { + get + { + return (int)FastPerform(2526, 0, 0); + } + + set + { + FastPerform(2525, (uint)value, 0); + } + } + + /// + /// Spacing below a line + /// + public int ExtraDescent + { + get + { + return (int)FastPerform(2528, 0, 0); + } + + set + { + FastPerform(2527, (uint)value, 0); + } + } + /// /// Returns the number of characters in the document. /// diff --git a/Source/Core/Controls/ScriptEditorControl.cs b/Source/Core/Controls/ScriptEditorControl.cs index 3c36c458..f70fad1f 100644 --- a/Source/Core/Controls/ScriptEditorControl.cs +++ b/Source/Core/Controls/ScriptEditorControl.cs @@ -130,6 +130,8 @@ namespace CodeImp.DoomBuilder.Controls scriptedit.SetFoldFlags((int)ScriptFoldFlag.Box); scriptedit.TabWidth = 4; // This should be in the preferences dialog scriptedit.Indent = 4; + scriptedit.ExtraAscent = 1; + scriptedit.ExtraDescent = 1; // Symbol margin scriptedit.SetMarginTypeN(0, (int)ScriptMarginType.Symbol); diff --git a/Source/Core/Map/MapSet.cs b/Source/Core/Map/MapSet.cs index 1ad3ee61..b01a5bd5 100644 --- a/Source/Core/Map/MapSet.cs +++ b/Source/Core/Map/MapSet.cs @@ -1887,22 +1887,26 @@ namespace CodeImp.DoomBuilder.Map if(l1 != l2) { bool oppositedirection = (l1.End == l2.Start); + bool l2marked = l2.Marked; // Merge these two linedefs while(lines.Remove(l2)) ; l2.Join(l1); - // The flipping is purely a cosmetic to preserve orientation - // when drawing new lines over older lines - if(oppositedirection) + if(l2marked) { - l1.FlipVertices(); - l1.FlipSidedefs(); + // The flipping is purely a cosmetic to preserve orientation + // when drawing new lines over older lines + if(oppositedirection) + { + l1.FlipVertices(); + l1.FlipSidedefs(); + } + + // Direction is now the same, so the interior side is also the same + // We have to copy the interior side to preserve this for drawing + l1.FrontInterior = l2.FrontInterior; } - - // Direction is now the same, so the interior side is also the same - // We have to copy the interior side to preserve this for drawing - l1.FrontInterior = l2.FrontInterior; joinsdone++; joined = true; @@ -1925,22 +1929,26 @@ namespace CodeImp.DoomBuilder.Map if(l1 != l2) { bool oppositedirection = (l1.Start == l2.End); - + bool l2marked = l2.Marked; + // Merge these two linedefs while(lines.Remove(l2)) ; l2.Join(l1); - // The flipping is purely a cosmetic to preserve orientation - // when drawing new lines over older lines - if(oppositedirection) + if(l2marked) { - l1.FlipVertices(); - l1.FlipSidedefs(); - } + // The flipping is purely a cosmetic to preserve orientation + // when drawing new lines over older lines + if(oppositedirection) + { + l1.FlipVertices(); + l1.FlipSidedefs(); + } - // Direction is now the same, so the interior side is also the same - // We have to copy the interior side to preserve this for drawing - l1.FrontInterior = l2.FrontInterior; + // Direction is now the same, so the interior side is also the same + // We have to copy the interior side to preserve this for drawing + l1.FrontInterior = l2.FrontInterior; + } joinsdone++; joined = true;