Skip to content

Commit

Permalink
fix handling of e.g. align=Align.MIN for Grid and HexLocations
Browse files Browse the repository at this point in the history
  • Loading branch information
jdegenstein authored Oct 10, 2023
1 parent 451bba7 commit ed34089
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/build123d/build_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,11 +855,11 @@ def __init__(
# Calculate the amount to offset the array to align it
align_offset = []
for i in range(2):
if align[i] == Align.MIN:
if self.align[i] == Align.MIN:
align_offset.append(0)
elif align[i] == Align.CENTER:
elif self.align[i] == Align.CENTER:
align_offset.append(-size[i] / 2)
elif align[i] == Align.MAX:
elif self.align[i] == Align.MAX:
align_offset.append(-size[i])

# Align the points
Expand Down Expand Up @@ -1036,11 +1036,11 @@ def __init__(
size = [x_spacing * (x_count - 1), y_spacing * (y_count - 1)]
align_offset = []
for i in range(2):
if align[i] == Align.MIN:
if self.align[i] == Align.MIN:
align_offset.append(0.0)
elif align[i] == Align.CENTER:
elif self.align[i] == Align.CENTER:
align_offset.append(-size[i] / 2)
elif align[i] == Align.MAX:
elif self.align[i] == Align.MAX:
align_offset.append(-size[i])

# Create the list of local locations
Expand Down

0 comments on commit ed34089

Please sign in to comment.