Skip to content

Commit

Permalink
fix: Duplicated arrowhead drawing (#1709)
Browse files Browse the repository at this point in the history
  • Loading branch information
schochastics authored Feb 21, 2025
1 parent 3764c00 commit 1176a04
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -1007,14 +1007,14 @@ igraph.Arrows <-
p.x2 <- rep(bx2, Rep)
p.y2 <- rep(by2, Rep)
ttheta <- rep(theta, Rep) + rep(deg.arr, lx)
r.arr <- rep(r.arr, lx)
r.arr.rep <- rep(r.arr, lx)
if (open) {
lines((p.x2 + r.arr * cos(ttheta) / uin[1]),
(p.y2 + r.arr * sin(ttheta) / uin[2]),
lines((p.x2 + r.arr.rep * cos(ttheta) / uin[1]),
(p.y2 + r.arr.rep * sin(ttheta) / uin[2]),
lwd = h.lwd, col = h.col.bo, lty = h.lty
)
} else {
polygon(p.x2 + r.arr * cos(ttheta) / uin[1], p.y2 + r.arr * sin(ttheta) / uin[2],
polygon(p.x2 + r.arr.rep * cos(ttheta) / uin[1], p.y2 + r.arr * sin(ttheta) / uin[2],
col = h.col, lwd = h.lwd,
border = h.col.bo, lty = h.lty
)
Expand All @@ -1037,15 +1037,15 @@ igraph.Arrows <-
p.x2 <- rep(x2, Rep)
p.y2 <- rep(y2, Rep)
ttheta <- rep(theta, Rep) + rep(deg.arr, lx)
r.arr <- rep(r.arr, lx)
r.arr.rep <- rep(r.arr, lx)

if (open) {
lines((p.x2 + r.arr * cos(ttheta) / uin[1]),
(p.y2 + r.arr * sin(ttheta) / uin[2]),
lines((p.x2 + r.arr.rep * cos(ttheta) / uin[1]),
(p.y2 + r.arr.rep * sin(ttheta) / uin[2]),
lwd = h.lwd, col = h.col.bo, lty = h.lty
)
} else {
polygon(p.x2 + r.arr * cos(ttheta) / uin[1], p.y2 + r.arr * sin(ttheta) / uin[2],
polygon(p.x2 + r.arr.rep * cos(ttheta) / uin[1], p.y2 + r.arr.rep * sin(ttheta) / uin[2],
col = h.col, lwd = h.lwd,
border = h.col.bo, lty = h.lty
)
Expand Down

0 comments on commit 1176a04

Please sign in to comment.