koishi-plugin-chat-analyse 1.6.5 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +1 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1784,7 +1784,7 @@ var Renderer = class {
|
|
|
1784
1784
|
const relativeSize = relativeFontSizes[i];
|
|
1785
1785
|
estimatedCurrentArea += Math.pow(relativeSize, 2) * wordText.length * 0.6;
|
|
1786
1786
|
}
|
|
1787
|
-
const scalingFactor = Math.sqrt(600 * 600 * 0.
|
|
1787
|
+
const scalingFactor = Math.sqrt(600 * 600 * 0.9 / Math.max(1, estimatedCurrentArea));
|
|
1788
1788
|
const wordList = words.map((word, i) => {
|
|
1789
1789
|
let finalSize = relativeFontSizes[i] * scalingFactor;
|
|
1790
1790
|
finalSize = Math.max(4, Math.min(128, finalSize));
|
|
@@ -1814,7 +1814,6 @@ var Renderer = class {
|
|
|
1814
1814
|
list: ${JSON.stringify(wordList)},
|
|
1815
1815
|
weightFactor: (size) => size,
|
|
1816
1816
|
backgroundColor: 'transparent',
|
|
1817
|
-
drawOutOfBound: true,
|
|
1818
1817
|
clearCanvas: false,
|
|
1819
1818
|
shrinkToFit: true,
|
|
1820
1819
|
rotateRatio: 1,
|