Skip to content

Commit

Permalink
Don't set offset to default if center.
Browse files Browse the repository at this point in the history
  • Loading branch information
kajuberdut committed Nov 16, 2023
1 parent a6af49d commit 5b461b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/roadmapper/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ def from_string(
default_offset_type: Optional[OffsetType] = None,
default_offset: Optional[float] = None,
) -> "Alignment":
new = cls(offset_type=default_offset_type, offset=default_offset)
new = cls()
new.update_from_alignment_string(alignment)
if new.direction != AlignmentDirection.CENTER:
new.offset_type = new.offset_type or default_offset_type
new.offset = new.offset or default_offset
new.validate()
return new

Expand Down

0 comments on commit 5b461b9

Please sign in to comment.