Skip to content

Commit

Permalink
refactor: 优化变量
Browse files Browse the repository at this point in the history
  • Loading branch information
yixy-only authored and wysaid committed Oct 4, 2024
1 parent 3c94266 commit 67b7180
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/egegapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1082,8 +1082,6 @@ void bar3d(int left, int top, int right, int bottom, int depth, int topFlag, PIM
{left + depth, top - depth},
};

/* 正面右上边界的3个顶点 */
POINT sideVertexes[3] = {{left, top}, {right, top}, {right, bottom}};

bar(left, top, right, bottom, pimg);

Expand All @@ -1092,13 +1090,15 @@ void bar3d(int left, int top, int right, int bottom, int depth, int topFlag, PIM
setlinecap(LINECAP_FLAT, pimg);

if (topFlag) {
/* 正面右上边界的3个顶点 */
POINT sideVertexes[3] = {{left, top}, {right, top}, {right, bottom}};
polygon(6, (const int*)boundVertexes, pimg);
polyline(3, (const int*)&sideVertexes, pimg);
line(right, top, right + depth, top - depth, pimg);
} else {
/* 只绘制与底部相连的 5 条边 */
polyline(5, (const int*)boundVertexes, pimg);
line(sideVertexes[1].x, sideVertexes[1].y, sideVertexes[2].x, sideVertexes[2].y, pimg);
line(right, top, right, bottom, pimg);
}

setlinecap(startCap, endCap, pimg);
Expand Down

0 comments on commit 67b7180

Please sign in to comment.