From 9d38907e95dac76a6b9754562752c36e3f65b9ec Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 24 Jul 2018 12:18:01 +0200 Subject: Add G_ARROW (for now same look as G_LINE) Signed-off-by: Clifford Wolf --- common/nextpnr.h | 1 + gui/fpgaviewwidget.cc | 4 ++-- ice40/gfx.cc | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common/nextpnr.h b/common/nextpnr.h index 021772fe..3ba4f3b3 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -147,6 +147,7 @@ struct GraphicElement { G_NONE, G_LINE, + G_ARROW, G_BOX, G_CIRCLE, G_LABEL diff --git a/gui/fpgaviewwidget.cc b/gui/fpgaviewwidget.cc index e21af678..cd288deb 100644 --- a/gui/fpgaviewwidget.cc +++ b/gui/fpgaviewwidget.cc @@ -327,7 +327,7 @@ void FPGAViewWidget::drawDecal(LineShaderData &out, const DecalXY &decal) line.build(out); } - if (el.type == GraphicElement::G_LINE) { + if (el.type == GraphicElement::G_LINE || el.type == GraphicElement::G_ARROW) { PolyLine(offsetX + scale * el.x1, offsetY + scale * el.y1, offsetX + scale * el.x2, offsetY + scale * el.y2) .build(out); } @@ -360,7 +360,7 @@ void FPGAViewWidget::drawDecal(LineShaderData out[], const DecalXY &decal) } } - if (el.type == GraphicElement::G_LINE) { + if (el.type == GraphicElement::G_LINE || el.type == GraphicElement::G_ARROW) { auto line = PolyLine(offsetX + scale * el.x1, offsetY + scale * el.y1, offsetX + scale * el.x2, offsetY + scale * el.y2); switch (el.style) { diff --git a/ice40/gfx.cc b/ice40/gfx.cc index f6ed789f..1b01cbd8 100644 --- a/ice40/gfx.cc +++ b/ice40/gfx.cc @@ -647,7 +647,7 @@ void pipGfx(std::vector &g, int x, int y, float x1, float y1, fl float ty = 0.5 * (y1 + y2); GraphicElement el; - el.type = GraphicElement::G_LINE; + el.type = GraphicElement::G_ARROW; el.style = style; if (fabsf(x1 - swx1) < 0.001 && fabsf(x2 - swx1) < 0.001) { -- cgit v1.2.3