From 5577b38b205ee11185fa22780e61822115ff99a8 Mon Sep 17 00:00:00 2001 From: BlogMan <66019007+gsycl2004@users.noreply.github.com> Date: Sat, 4 Jun 2022 16:34:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AEangleGenerator=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/WordCloudUtils.kt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/WordCloudUtils.kt b/src/main/kotlin/WordCloudUtils.kt index c50fb4d..547e329 100644 --- a/src/main/kotlin/WordCloudUtils.kt +++ b/src/main/kotlin/WordCloudUtils.kt @@ -7,6 +7,7 @@ import com.kennycason.kumo.bg.CircleBackground import com.kennycason.kumo.bg.PixelBoundaryBackground import com.kennycason.kumo.font.KumoFont import com.kennycason.kumo.font.scale.LinearFontScalar +import com.kennycason.kumo.image.AngleGenerator import com.kennycason.kumo.nlp.FrequencyAnalyzer import com.kennycason.kumo.palette.ColorPalette import java.awt.Color @@ -25,6 +26,7 @@ object WordCloudUtils { val dimension = Dimension(WordCloudConfig.width, WordCloudConfig.height) val wordCloud = WordCloud(dimension, CollisionMode.PIXEL_PERFECT) wordCloud.setPadding(2) + wordCloud.setAngleGenerator(AngleGenerator(0)) wordCloud.setKumoFont( if (WordCloudConfig.fontPath == "default") KumoFont(WordCloudPlugin.getResourceAsStream("萝莉体.ttf")) @@ -49,12 +51,5 @@ object WordCloudUtils { return stream.toByteArray() } - fun getBeforeDay(date: Date = Date(), before: Int = 1): Date { - var date = date - val calendar = Calendar.getInstance() - calendar.time = date - calendar.add(Calendar.DAY_OF_MONTH, -before) - date = calendar.time - return date - } + } \ No newline at end of file