From 67b7180d7241f7b24da1755faabea2ece21415ed Mon Sep 17 00:00:00 2001 From: yixy-only Date: Fri, 4 Oct 2024 12:53:33 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E5=8F=98?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/egegapi.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/egegapi.cpp b/src/egegapi.cpp index 3378bcd..7e1527d 100644 --- a/src/egegapi.cpp +++ b/src/egegapi.cpp @@ -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); @@ -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);