This commit is contained in:
codeimp 2008-09-24 12:00:55 +00:00
parent dcda9cdab3
commit 15693e1ca8

View file

@ -76,7 +76,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
private const float GRIP_SIZE = 9.0f; private const float GRIP_SIZE = 9.0f;
private const float ZERO_SIZE_ADDITION = 20.0f; private const float ZERO_SIZE_ADDITION = 20.0f;
private const byte RECTANGLE_ALPHA = 60; private const byte RECTANGLE_ALPHA = 60;
private const byte EXTENSION_LINE_ALPHA = 200; private const byte EXTENSION_LINE_ALPHA = 150;
private readonly Cursor[] RESIZE_CURSORS = { Cursors.SizeNS, Cursors.SizeNWSE, Cursors.SizeWE, Cursors.SizeNESW }; private readonly Cursor[] RESIZE_CURSORS = { Cursors.SizeNS, Cursors.SizeNWSE, Cursors.SizeWE, Cursors.SizeNESW };
#endregion #endregion
@ -370,15 +370,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
Vector2D newcorner = TransformedPoint(originalcorners[stickcorner]); Vector2D newcorner = TransformedPoint(originalcorners[stickcorner]);
offset -= newcorner - oldcorner; offset -= newcorner - oldcorner;
// Snappedmappos is outside the edgevector of our rectangle? // Show the extension line so that the user knows what it is aligning to
// Then show the extension line so that the user knows what it is aligning to
Vector2D sizefiltered = (size * resizefilter); Vector2D sizefiltered = (size * resizefilter);
float sizelength = sizefiltered.x + sizefiltered.y; float sizelength = sizefiltered.x + sizefiltered.y;
Line2D edgeline = new Line2D(resizeaxis.v1 + resizevector * sizelength, resizeaxis.v1 + resizevector * sizelength - edgevector); Line2D edgeline = new Line2D(resizeaxis.v1 + resizevector * sizelength, resizeaxis.v1 + resizevector * sizelength - edgevector);
float nearestonedge = edgeline.GetNearestOnLine(snappedmappos); float nearestonedge = edgeline.GetNearestOnLine(snappedmappos);
if(nearestonedge > 0.5f) if(nearestonedge > 0.5f)
extensionline = new Line2D(edgeline.v1, snappedmappos); extensionline = new Line2D(edgeline.v1, snappedmappos);
else if(nearestonedge < 0.5f) else
extensionline = new Line2D(edgeline.v2, snappedmappos); extensionline = new Line2D(edgeline.v2, snappedmappos);
// Update // Update