Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Intersect() [1/2]

static Rectangle Microsoft.Xna.Framework.Rectangle.Intersect ( Rectangle value1,
Rectangle value2 )
inlinestatic

Definition at line 143 of file Rectangle.cs.

144 {
145 int num = value1.X + value1.Width;
146 int num2 = value2.X + value2.Width;
147 int num3 = value1.Y + value1.Height;
148 int num4 = value2.Y + value2.Height;
149 int num5 = ((value1.X > value2.X) ? value1.X : value2.X);
150 int num6 = ((value1.Y > value2.Y) ? value1.Y : value2.Y);
151 int num7 = ((num < num2) ? num : num2);
152 int num8 = ((num3 < num4) ? num3 : num4);
153 Rectangle result = default(Rectangle);
154 if (num7 > num5 && num8 > num6)
155 {
156 result.X = num5;
157 result.Y = num6;
158 result.Width = num7 - num5;
159 result.Height = num8 - num6;
160 }
161 else
162 {
163 result.X = 0;
164 result.Y = 0;
165 result.Width = 0;
166 result.Height = 0;
167 }
168 return result;
169 }
Rectangle(int x, int y, int width, int height)
Definition Rectangle.cs:64

References Microsoft.Xna.Framework.Rectangle.Height, Microsoft.Xna.Framework.Rectangle.Width, Microsoft.Xna.Framework.Rectangle.X, and Microsoft.Xna.Framework.Rectangle.Y.

Referenced by Terraria.Graphics.Capture.CaptureInterface.ModeDragBounds.DragBounds(), Terraria.Graphics.Capture.CaptureInterface.ModeEdgeSelection.DrawMarkedArea(), Terraria.Graphics.Capture.CaptureInterface.ModeDragBounds.DrawMarkedArea(), Terraria.Graphics.Light.LightingEngine.ExportToMiniMap(), Terraria.Player.FindSharpTearsSpot(), Terraria.NPC.GetFairyTreasureCoords(), Terraria.GameContent.DoorOpeningHelper.CommonDoorOpeningInfoProvider.TryCloseDoor(), and Terraria.GameContent.DoorOpeningHelper.TallGateOpeningInfoProvider.TryCloseDoor().