|
@@ -154,23 +154,21 @@ class MoveSignatureTool {
|
|
|
|
|
|
// 临时签章移动事件(控制签章只能在报表中移动)
|
|
|
templateSignatureMove(event, me) {
|
|
|
-
|
|
|
-
|
|
|
+ // 表格大小
|
|
|
+ const size = me.jpcOutput.getReportSizeInPixel(me.pageObj, getScreenDPI());
|
|
|
const { top, left } = $("#rptCanvas").position();
|
|
|
- const canvasWidth = $("#rptCanvas").width();
|
|
|
- const canvasHeight = $("#rptCanvas").height();
|
|
|
const signatureWidth = $("#templateSignature").width();
|
|
|
const signatureHeight = $("#templateSignature").height();
|
|
|
- const maxTop = canvasHeight + top - signatureHeight; //签章的最大y坐标
|
|
|
- const maxLeft = canvasWidth + left - signatureWidth; //签章的最大x坐标
|
|
|
+ const maxTop = size[1] + top - signatureHeight + me.jpcOutput.offsetY * 2; //签章的最大y坐标
|
|
|
+ const maxLeft = size[0] + left - signatureWidth + me.jpcOutput.offsetX * 2; //签章的最大x坐标
|
|
|
|
|
|
const mousePos = me.getMousePos(event, me);
|
|
|
let newTop = mousePos.y - me.subPos.y + top;
|
|
|
let newLeft = mousePos.x - me.subPos.x + left;
|
|
|
if ((mousePos.y - me.subPos.y) < 0) newTop = top + me.jpcOutput.offsetY;
|
|
|
if ((mousePos.x - me.subPos.x) < 0) newLeft = left + me.jpcOutput.offsetX;
|
|
|
- if ((mousePos.y - me.subPos.y) > maxTop - top) newTop = maxTop - me.jpcOutput.offsetXY;
|
|
|
- if ((mousePos.x - me.subPos.x) > maxLeft - left) newLeft = maxLeft - me.jpcOutput.offsetX;
|
|
|
+ if ((mousePos.y - me.subPos.y) > maxTop - top) newTop = maxTop ;
|
|
|
+ if ((mousePos.x - me.subPos.x) > maxLeft - left) newLeft = maxLeft;
|
|
|
|
|
|
event.currentTarget.style.top = `${newTop}px`;
|
|
|
event.currentTarget.style.left = `${newLeft}px`;
|