Fix iCE40 pip gfx for pips on the top edge of a switchbox

Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
Clifford Wolf 2018-08-19 17:23:21 +02:00
parent 91c60ac667
commit e45769292a

View File

@ -920,22 +920,22 @@ void pipGfx(std::vector<GraphicElement> &g, int x, int y, float x1, float y1, fl
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) {
tx = x1 + 0.25 * fabsf(y1 - y2); tx = swx1 + 0.25 * fabsf(y1 - y2);
goto edge_pip; goto edge_pip;
} }
if (fabsf(x1 - swx2) < 0.001 && fabsf(x2 - swx2) < 0.001) { if (fabsf(x1 - swx2) < 0.001 && fabsf(x2 - swx2) < 0.001) {
tx = x1 - 0.25 * fabsf(y1 - y2); tx = swx2 - 0.25 * fabsf(y1 - y2);
goto edge_pip; goto edge_pip;
} }
if (fabsf(y1 - swy1) < 0.001 && fabsf(y2 - swy1) < 0.001) { if (fabsf(y1 - swy1) < 0.001 && fabsf(y2 - swy1) < 0.001) {
ty = y1 + 0.25 * fabsf(x1 - x2); ty = swy1 + 0.25 * fabsf(x1 - x2);
goto edge_pip; goto edge_pip;
} }
if (fabsf(y1 - swy1) < 0.001 && fabsf(y2 - swy1) < 0.001) { if (fabsf(y1 - swy2) < 0.001 && fabsf(y2 - swy2) < 0.001) {
ty = y1 + 0.25 * fabsf(x1 - x2); ty = swy2 - 0.25 * fabsf(x1 - x2);
goto edge_pip; goto edge_pip;
} }