Skip to content

Commit

Permalink
Doors: fix WidthWithoutFrame function
Browse files Browse the repository at this point in the history
  • Loading branch information
DmytroMuravskyi committed Jul 21, 2023
1 parent 8236aa4 commit 68d79d7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions LayoutFunctions/Doors/dependencies/Door.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ public static bool CanFit(Line wallLine, DoorType type, double width)

public override void UpdateRepresentations()
{
var doorWidth = WidthWithoutFrame(ClearWidth, Type);
Vector3 left = Vector3.XAxis * doorWidth / 2;
Vector3 right = Vector3.XAxis.Negate() * doorWidth / 2;
Vector3 left = Vector3.XAxis * ClearWidth / 2;
Vector3 right = Vector3.XAxis.Negate() * ClearWidth / 2;

var doorPolygon = new Polygon(new List<Vector3>() {
left + Vector3.YAxis * DOOR_THICKNESS,
Expand Down Expand Up @@ -74,9 +73,9 @@ private static double WidthWithoutFrame(double internalWidth, DoorType type)
switch (type)
{
case DoorType.Single:
return internalWidth + DOOR_FRAME_WIDTH * 2;
return internalWidth;
case DoorType.Double:
return internalWidth * 2 + DOOR_FRAME_WIDTH * 2;
return internalWidth * 2;
}
return 0;
}
Expand Down

0 comments on commit 68d79d7

Please sign in to comment.