修复GraphicsUtil.drawString方法签名变化导致的问题

This commit is contained in:
Looly
2024-08-12 18:49:51 +08:00
parent ee0b68dbb6
commit f2d0791b8b
2 changed files with 17 additions and 0 deletions

View File

@@ -118,6 +118,22 @@ public class GraphicsUtil {
return drawString(g, str, font, null, width, height, backgroundColor, ColorUtil.maxDistance(backgroundColor) / 2);
}
/**
* 绘制字符串,默认抗锯齿
*
* @param g {@link Graphics}画笔
* @param str 字符串
* @param font 字体
* @param color 字体颜色,{@code null} 表示使用随机颜色(每个字符单独随机)
* @param width 字符串背景的宽度
* @param height 字符串背景的高度
* @return 画笔对象
* @since 4.5.10
*/
public static Graphics drawString(Graphics g, String str, Font font, Color color, int width, int height) {
return drawString(g, str, font, color, width, height, null, 0);
}
/**
* 绘制字符串,默认抗锯齿
*