mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2024-11-10 06:41:49 +00:00
Fixed, DB2 bug: temporary map file was growing in size after every map save/test, which eventually resulted in integer overflow exception when the file size reached ~2Gb.
Fixed, Draw Geometry modes: fixed a crash when moving the mouse cursor over a linedef while holding Alt-Shift keys when there were no new points drawn in current mode.
This commit is contained in:
parent
6651a14bc6
commit
b2a14c59f8
1 changed files with 15 additions and 12 deletions
|
@ -378,20 +378,23 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
//mxd. Line angle must stay the same
|
||||
if(snaptocardinal)
|
||||
{
|
||||
Line2D ourline = new Line2D(points[points.Count - 1].pos, vm);
|
||||
Line2D nearestline = new Line2D(nl.Start.Position, nl.End.Position);
|
||||
Vector2D intersection = Line2D.GetIntersectionPoint(nearestline, ourline, false);
|
||||
if(!float.IsNaN(intersection.x))
|
||||
if(points.Count > 0)
|
||||
{
|
||||
// Intersection is on nearestline?
|
||||
float u = Line2D.GetNearestOnLine(nearestline.v1, nearestline.v2, intersection);
|
||||
|
||||
if(u < 0f || u > 1f){}
|
||||
else
|
||||
Line2D ourline = new Line2D(points[points.Count - 1].pos, vm);
|
||||
Line2D nearestline = new Line2D(nl.Start.Position, nl.End.Position);
|
||||
Vector2D intersection = Line2D.GetIntersectionPoint(nearestline, ourline, false);
|
||||
if(!float.IsNaN(intersection.x))
|
||||
{
|
||||
p.pos = new Vector2D((float)Math.Round(intersection.x, General.Map.FormatInterface.VertexDecimals),
|
||||
(float)Math.Round(intersection.y, General.Map.FormatInterface.VertexDecimals));
|
||||
return p;
|
||||
// Intersection is on nearestline?
|
||||
float u = Line2D.GetNearestOnLine(nearestline.v1, nearestline.v2, intersection);
|
||||
|
||||
if(u < 0f || u > 1f) { }
|
||||
else
|
||||
{
|
||||
p.pos = new Vector2D((float)Math.Round(intersection.x, General.Map.FormatInterface.VertexDecimals),
|
||||
(float)Math.Round(intersection.y, General.Map.FormatInterface.VertexDecimals));
|
||||
return p;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue