public float GetLengthSq() { return(l2d.GetLengthSq()); }
// This redraws the display public override void OnRedrawDisplay() { if (sectorinfo != null) { UpdateRectangleComponents(); } renderer.RedrawSurface(); // Render lines if (renderer.StartPlotter(true)) { renderer.PlotLinedefSet(General.Map.Map.Linedefs); renderer.PlotVerticesSet(General.Map.Map.Vertices); renderer.Finish(); } // Render things if (renderer.StartThings(true)) { renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA); renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, 1.0f); renderer.Finish(); } // Render overlay if (sectorinfo != null) { if (renderer.StartOverlay(true)) { // Rectangle PixelColor rectcolor = General.Colors.Highlight.WithAlpha(RECTANGLE_ALPHA); renderer.RenderGeometry(cornerverts, null, true); if (extensionline.GetLengthSq() > 0.0f) { renderer.RenderLine(extensionline.v1, extensionline.v2, 1, General.Colors.Indication.WithAlpha(EXTENSION_LINE_ALPHA), true); } renderer.RenderLine(corners[0], corners[1], 4, rectcolor, true); renderer.RenderLine(corners[1], corners[2], 4, rectcolor, true); renderer.RenderLine(corners[2], corners[3], 4, rectcolor, true); renderer.RenderLine(corners[3], corners[0], 4, rectcolor, true); // Lines renderer.RenderLine(corners[0], extends[0], 1f, General.Colors.Highlight, true); renderer.RenderLine(corners[0], extends[1], 1f, General.Colors.Highlight, true); renderer.RenderLine(corners[1], corners[2], 0.5f, General.Colors.Highlight, true); renderer.RenderLine(corners[2], corners[3], 0.5f, General.Colors.Highlight, true); // Handles renderer.RenderRectangleFilled(rotategrips[0], General.Colors.Background, true); renderer.RenderRectangleFilled(rotategrips[1], General.Colors.Background, true); renderer.RenderRectangle(rotategrips[0], 2f, General.Colors.Indication, true); renderer.RenderRectangle(rotategrips[1], 2f, General.Colors.Indication, true); renderer.RenderRectangleFilled(resizegrips[0], General.Colors.Background, true); renderer.RenderRectangleFilled(resizegrips[1], General.Colors.Background, true); renderer.RenderRectangle(resizegrips[0], 2f, General.Colors.Highlight, true); renderer.RenderRectangle(resizegrips[1], 2f, General.Colors.Highlight, true); // Rotate/align point if (showalignoffset) { renderer.RenderRectangleFilled(alignrect, General.Colors.Selection, true); } renderer.Finish(); } } renderer.Present(); }
public float GetLengthSq() { return(Line2D.GetLengthSq(v2.x - v1.x, v2.y - v1.y)); }