Skip to content

Commit

Permalink
Fix bug with more than 2 polygon siblings
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-knight committed Jan 8, 2025
1 parent 95ddb59 commit 5907751
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/calculate.clone.polygons.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ position.polygons <- function(
parent.angle <- atan(dist / par$len);
}
} else {
if (v$id == siblings$id[which.min(siblings$x.mid)]) {
if (vi$id == siblings$id[which.min(siblings$x.mid)]) {
# Align leftmost child with left outer clone border
parent.angle <- ifelse(
is.null(fixed.angle),
yes = atan(-(abs(par$x1) / par$len)),
no = -(fixed.angle)
);
} else if (v$id == siblings$id[which.max(siblings$x.mid)]) {
} else if (vi$id == siblings$id[which.max(siblings$x.mid)]) {
# Align rightmost child with right outer clone border
parent.angle <- ifelse(
is.null(fixed.angle),
Expand Down

0 comments on commit 5907751

Please sign in to comment.