diff --git a/Source/BuilderModes/VerticesMode/DragVerticesMode.cs b/Source/BuilderModes/VerticesMode/DragVerticesMode.cs index 111fe412..b7645aab 100644 --- a/Source/BuilderModes/VerticesMode/DragVerticesMode.cs +++ b/Source/BuilderModes/VerticesMode/DragVerticesMode.cs @@ -72,6 +72,11 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing // List of unstable lines private ICollection unstablelines; + // Keep track of view changes + private float lastoffsetx; + private float lastoffsety; + private float lastscale; + // Options private bool snaptogrid; // SHIFT to toggle private bool snaptonearest; // CTRL to enable @@ -112,6 +117,11 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing // Also keep old position of the dragged item dragitemposition = dragitem.Position; + // Keep view information + lastoffsetx = renderer.OffsetX; + lastoffsety = renderer.OffsetY; + lastscale = renderer.Scale; + // Make list of unstable lines only // These will have their length displayed during the drag unstablelines = General.Map.Map.LinedefsFromSelectedVertices(false, false, true); @@ -268,8 +278,15 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing // This redraws the display public unsafe override void RedrawDisplay() { + bool viewchanged = false; + + // View changed? + if(renderer.OffsetX != lastoffsetx) viewchanged = true; + if(renderer.OffsetY != lastoffsety) viewchanged = true; + if(renderer.Scale != lastscale) viewchanged = true; + // Start rendering - if(renderer.Start(true, false)) + if(renderer.Start(true, viewchanged)) { // Uncomment this to see triangulation /* @@ -283,6 +300,18 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing } } */ + + // Redraw things when view changed + if(viewchanged) + { + renderer.SetThingsRenderOrder(false); + renderer.RenderThingSet(General.Map.Map.Things); + + // Keep view information + lastoffsetx = renderer.OffsetX; + lastoffsety = renderer.OffsetY; + lastscale = renderer.Scale; + } // Render lines and vertices renderer.RenderLinedefSet(General.Map.Map.Linedefs); diff --git a/Source/Controls/ActionAttribute.cs b/Source/Controls/ActionAttribute.cs index 058ccd79..675954f6 100644 --- a/Source/Controls/ActionAttribute.cs +++ b/Source/Controls/ActionAttribute.cs @@ -141,7 +141,6 @@ namespace CodeImp.DoomBuilder.Controls actionname = a.GetFullActionName(type.Assembly); // Bind method to action - General.WriteLogLine("Binding '" + actionname + "'"); if(General.Actions.Exists(actionname)) General.Actions[actionname].Bind(del); else @@ -209,7 +208,6 @@ namespace CodeImp.DoomBuilder.Controls actionname = a.GetFullActionName(type.Assembly); // Unbind method from action - General.WriteLogLine("Unbinding '" + actionname + "'"); General.Actions[actionname].Unbind(del); } }