Commit 9c45500f authored by 董国亮's avatar 董国亮

优化诱导屏竖向排列逻辑

parent f6ca9cd9
......@@ -293,15 +293,23 @@ public class InduceSendServiceImpl implements InduceSendService {
g.drawString(text[0], x, y);
} else { // 纵向
// 字体高度的70%
int verticalSpacing = (int) (textHeight * 0.7);
int verticalSpacing = (int) (textHeight * 0.95);
// 逐个字符绘制文字
for (int i = 0; i < text.length; i++) {
if (i == 0) {
g.drawString(text[i], x, y);
} else {
g.drawString(text[i], x, y + (i * verticalSpacing));
}
if(text[0].split("-").length==2) {
g.drawString(" "+text[0].split("-")[0], x, y);
g.drawString(" |", x, y + (1 * verticalSpacing));
g.drawString(" "+text[0].split("-")[1].replace("km/h",""), x, y + (2 * verticalSpacing));
g.drawString("km/h", x, y + (3 * verticalSpacing));
}else{
g.drawString(text[0], x, y);
}
// for (int i = 0; i < text[0].split("-")[1]; i++) {
// if (i%2 == 0) {
// g.drawString(text[i], x, y);
// } else {
// g.drawString(text[i], x, y + (i * verticalSpacing));
// }
// }
}
// 释放资源
g.dispose();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment