Browse Source

轨迹还原bug修改

1.大题总分显示相对位置改为0,渲染时判断实际坐标不能小于文字大小
2.所有裁切图渲染轨迹时修正Y轴坐标计算bug
luoshi 6 years ago
parent
commit
ca108e1aa2

+ 1 - 1
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/service/impl/ExamStudentServiceImpl.java

@@ -769,7 +769,7 @@ public class ExamStudentServiceImpl extends BaseQueryService<ExamStudent> implem
         // 原图中需要显示的内容列表
         List<OriginTag> originTags = new LinkedList<>();
         // 首先添加本大题总得分
-        originTags.add(new OriginTag(format.format(score), 0.1, 0.01));
+        originTags.add(new OriginTag(format.format(score), 0, 0));
         // 检测应该使用哪个评卷任务的轨迹记录
         MarkLibrary selected = null;
         List<MarkLibrary> libraries = libraryService.findByStudentAndGroup(student.getId(), group.getNumber());

+ 2 - 2
stmms-web/src/main/java/cn/com/qmth/stmms/api/utils/SheetBuildUtil.java

@@ -19,9 +19,9 @@ public class SheetBuildUtil {
             Graphics2D g = newImg.createGraphics();
             g.drawImage(image, 0, 0, image.getWidth(), image.getHeight(), null);
             g.setColor(Color.RED);
-            g.setFont(new Font("Arial", Font.PLAIN, 50));
+            g.setFont(new Font("Arial", Font.PLAIN, 60));
             for (PictureTag tag : tags) {
-                g.drawString(tag.getContent(), tag.getLeft(), tag.getTop());
+                g.drawString(tag.getContent(), Math.max(60, tag.getLeft()), Math.max(60, tag.getTop()));
             }
             g.dispose();
             image = newImg;

+ 1 - 1
stmms-web/src/main/webapp/WEB-INF/views/modules/exam/studentTrack.jsp

@@ -99,7 +99,7 @@ function renderGroup(group, images) {
                     // 根据绝对高度判断显示元素是否落在当前拼接块
                     ctx.font ="60px Arial";
                     ctx.fillStyle ='red';
-                    ctx.fillText(tag.content, left+config.x+image.left, top+config.y+image.top);
+                    ctx.fillText(tag.content, Math.max(60,left+config.x+image.left), Math.max(60,top-start+config.y+image.top));
                     break;
                 } else {
                     start += config.h;