diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-07-24 12:18:01 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-07-24 12:18:01 +0200 |
commit | 9d38907e95dac76a6b9754562752c36e3f65b9ec (patch) | |
tree | d1b62a51b051c7493e03286074fd54e6cca39fdb | |
parent | 7858663aa7f211cebde2d543f7d0094d84ca11b1 (diff) | |
download | nextpnr-9d38907e95dac76a6b9754562752c36e3f65b9ec.tar.gz nextpnr-9d38907e95dac76a6b9754562752c36e3f65b9ec.tar.bz2 nextpnr-9d38907e95dac76a6b9754562752c36e3f65b9ec.zip |
Add G_ARROW (for now same look as G_LINE)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
-rw-r--r-- | common/nextpnr.h | 1 | ||||
-rw-r--r-- | gui/fpgaviewwidget.cc | 4 | ||||
-rw-r--r-- | 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<GraphicElement> &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) { |