From c99eb98001e22f671ce514268231edcd27fc73ef Mon Sep 17 00:00:00 2001 From: 稚屿 <1491182878@qq.com> Date: 星期三, 09 二月 2022 09:10:50 +0800 Subject: [PATCH] 代码优化 --- ruoyi-common/src/main/java/com/ruoyi/common/utils/VerifyCodeUtils.java | 11 +++-------- 1 files changed, 3 insertions(+), 8 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/VerifyCodeUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/VerifyCodeUtils.java index 0417181..45b80bb 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/VerifyCodeUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/VerifyCodeUtils.java @@ -208,7 +208,6 @@ int period = random.nextInt(40) + 10; // 50; - boolean borderGap = true; int frames = 20; int phase = 7; for (int i = 0; i < w1; i++) @@ -216,13 +215,9 @@ double d = (double) (period >> 1) * Math.sin((double) i / (double) period + (6.2831853071795862D * (double) phase) / (double) frames); g.copyArea(i, 0, 1, h1, 0, (int) d); - if (borderGap) - { - g.setColor(color); - g.drawLine(i, (int) d, i, 0); - g.drawLine(i, (int) d + h1, i, h1); - } - + g.setColor(color); + g.drawLine(i, (int) d, i, 0); + g.drawLine(i, (int) d + h1, i, h1); } } } \ No newline at end of file -- Gitblit v1.9.2