Add G_ARROW (for now same look as G_LINE)

Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
Clifford Wolf 2018-07-24 12:18:01 +02:00
parent 7858663aa7
commit 9d38907e95
3 changed files with 4 additions and 3 deletions

View File

@ -147,6 +147,7 @@ struct GraphicElement
{ {
G_NONE, G_NONE,
G_LINE, G_LINE,
G_ARROW,
G_BOX, G_BOX,
G_CIRCLE, G_CIRCLE,
G_LABEL G_LABEL

View File

@ -327,7 +327,7 @@ void FPGAViewWidget::drawDecal(LineShaderData &out, const DecalXY &decal)
line.build(out); 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) PolyLine(offsetX + scale * el.x1, offsetY + scale * el.y1, offsetX + scale * el.x2, offsetY + scale * el.y2)
.build(out); .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, auto line = PolyLine(offsetX + scale * el.x1, offsetY + scale * el.y1, offsetX + scale * el.x2,
offsetY + scale * el.y2); offsetY + scale * el.y2);
switch (el.style) { switch (el.style) {

View File

@ -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); float ty = 0.5 * (y1 + y2);
GraphicElement el; GraphicElement el;
el.type = GraphicElement::G_LINE; el.type = GraphicElement::G_ARROW;
el.style = style; el.style = style;
if (fabsf(x1 - swx1) < 0.001 && fabsf(x2 - swx1) < 0.001) { if (fabsf(x1 - swx1) < 0.001 && fabsf(x2 - swx1) < 0.001) {