From f2ab92860558f17663eec06cab48be26635fed3a Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 17 Apr 2026 00:33:30 +0200 Subject: [PATCH] rogueviz:: edge have arrow_scale --- rogueviz/graphs.cpp | 13 +++++++++++++ rogueviz/rogueviz.h | 1 + 2 files changed, 14 insertions(+) diff --git a/rogueviz/graphs.cpp b/rogueviz/graphs.cpp index 78015002..70c3b1a1 100644 --- a/rogueviz/graphs.cpp +++ b/rogueviz/graphs.cpp @@ -661,6 +661,19 @@ void draw_edge(const shiftmatrix &V, cell *c, edgeinfo *ei) { storeline(ei->prec, inverse_shift(T, h1), inverse_shift(T, h2)); } + if(ei->type->arrow_scale) { + auto T2 = gm2 * vd2.m->at; + auto T1 = gm1 * vd1.m->at; + auto T = inverse_shift(T1, T2); + auto X = rspintox(T * C0) * xpush(hdist(T1*C0, T2*C0)/2); + auto cs = cgi.scalefactor * ei->type->arrow_scale; + curvepoint(xpush0(0.1 * cs)); + curvepoint(xpush(-0.1 * cs) * ypush0(0.05 * cs)); + curvepoint(xpush(-0.1 * cs) * ypush0(-0.05 * cs)); + curvepoint(xpush0(0.1 * cs)); + queuecurve(gm1 * X, col, col, PPR::STRUCT0); + } + const shiftmatrix& T = multidraw ? V : ggmatrix(ei->orig); queue_prec(T, ei, col); diff --git a/rogueviz/rogueviz.h b/rogueviz/rogueviz.h index 558b703e..46dc9fe0 100644 --- a/rogueviz/rogueviz.h +++ b/rogueviz/rogueviz.h @@ -54,6 +54,7 @@ namespace rogueviz { double visible_from_hi; unsigned color, color_hi; string name; + double arrow_scale = 0; }; edgetype *add_edgetype(const string& name);