Commit bf2e73df authored by Sergey Luzyanin's avatar Sergey Luzyanin

correct handling mousedown

parent a98fc8de
...@@ -71,6 +71,12 @@ StartAddNewShape.prototype = ...@@ -71,6 +71,12 @@ StartAddNewShape.prototype =
{ {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR) if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {objectId: null, bMarker: true}; return {objectId: null, bMarker: true};
if(this.bStart){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
this.pageIndex = pageIndex; this.pageIndex = pageIndex;
this.startX = x; this.startX = x;
this.startY = y; this.startY = y;
...@@ -421,7 +427,14 @@ function PreChangeAdjState(drawingObjects, majorObject) ...@@ -421,7 +427,14 @@ function PreChangeAdjState(drawingObjects, majorObject)
PreChangeAdjState.prototype = PreChangeAdjState.prototype =
{ {
onMouseDown: function(e, x, y, pageIndex) onMouseDown: function(e, x, y, pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()};
},
onMouseMove: function(e, x, y, pageIndex) onMouseMove: function(e, x, y, pageIndex)
{ {
...@@ -454,6 +467,10 @@ PreMoveInlineObject.prototype = ...@@ -454,6 +467,10 @@ PreMoveInlineObject.prototype =
{ {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR) if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()}; return {cursorType: "default", objectId: this.majorObject.Get_Id()};
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
}, },
onMouseMove: function(e, x, y, pageIndex) onMouseMove: function(e, x, y, pageIndex)
...@@ -490,6 +507,10 @@ MoveInlineObject.prototype = ...@@ -490,6 +507,10 @@ MoveInlineObject.prototype =
{ {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR) if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()}; return {cursorType: "default", objectId: this.majorObject.Get_Id()};
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
}, },
onMouseMove: function(e, x, y, pageIndex) onMouseMove: function(e, x, y, pageIndex)
...@@ -552,7 +573,15 @@ function PreRotateState(drawingObjects, majorObject) ...@@ -552,7 +573,15 @@ function PreRotateState(drawingObjects, majorObject)
PreRotateState.prototype = PreRotateState.prototype =
{ {
onMouseDown: function(e, x, y, pageIndex) onMouseDown: function(e, x, y, pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()};
},
onMouseMove: function(e, x, y, pageIndex) onMouseMove: function(e, x, y, pageIndex)
{ {
...@@ -582,7 +611,15 @@ function RotateState(drawingObjects, majorObject) ...@@ -582,7 +611,15 @@ function RotateState(drawingObjects, majorObject)
RotateState.prototype = RotateState.prototype =
{ {
onMouseDown: function(e, x, y, pageIndex) onMouseDown: function(e, x, y, pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()};
},
onMouseMove: function(e, x, y, pageIndex) onMouseMove: function(e, x, y, pageIndex)
{ {
...@@ -732,7 +769,15 @@ function ChangeAdjState(drawingObjects, majorObject) ...@@ -732,7 +769,15 @@ function ChangeAdjState(drawingObjects, majorObject)
ChangeAdjState.prototype = ChangeAdjState.prototype =
{ {
onMouseDown: function(e, x, y, pageIndex) onMouseDown: function(e, x, y, pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()};
},
onMouseMove: function(e, x, y, pageIndex) onMouseMove: function(e, x, y, pageIndex)
{ {
...@@ -761,7 +806,14 @@ function PreResizeState(drawingObjects, majorObject, cardDirection) ...@@ -761,7 +806,14 @@ function PreResizeState(drawingObjects, majorObject, cardDirection)
PreResizeState.prototype = PreResizeState.prototype =
{ {
onMouseDown: function(e, x, y, pageIndex) onMouseDown: function(e, x, y, pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()};
},
onMouseMove: function(e, x, y, pageIndex) onMouseMove: function(e, x, y, pageIndex)
{ {
...@@ -792,7 +844,14 @@ function ResizeState(drawingObjects, majorObject, handleNum) ...@@ -792,7 +844,14 @@ function ResizeState(drawingObjects, majorObject, handleNum)
ResizeState.prototype = ResizeState.prototype =
{ {
onMouseDown: function(e, x, y, pageIndex) onMouseDown: function(e, x, y, pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()};
},
onMouseMove: function(e, x, y, pageIndex) onMouseMove: function(e, x, y, pageIndex)
{ {
...@@ -826,7 +885,14 @@ function PreMoveState(drawingObjects, startX, startY, shift, ctrl, majorObject, ...@@ -826,7 +885,14 @@ function PreMoveState(drawingObjects, startX, startY, shift, ctrl, majorObject,
PreMoveState.prototype = PreMoveState.prototype =
{ {
onMouseDown: function(e, x, y, pageIndex) onMouseDown: function(e, x, y, pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()};
},
onMouseMove: function(e, x, y, pageIndex) onMouseMove: function(e, x, y, pageIndex)
{ {
...@@ -861,7 +927,14 @@ function MoveState(drawingObjects, majorObject, startX, startY) ...@@ -861,7 +927,14 @@ function MoveState(drawingObjects, majorObject, startX, startY)
MoveState.prototype = MoveState.prototype =
{ {
onMouseDown: function(e, x, y, pageIndex) onMouseDown: function(e, x, y, pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()};
},
onMouseMove: function(e, x, y, pageIndex) onMouseMove: function(e, x, y, pageIndex)
{ {
...@@ -1097,7 +1170,14 @@ function PreMoveInGroupState(drawingObjects, group, startX, startY, ShiftKey, Ct ...@@ -1097,7 +1170,14 @@ function PreMoveInGroupState(drawingObjects, group, startX, startY, ShiftKey, Ct
PreMoveInGroupState.prototype = PreMoveInGroupState.prototype =
{ {
onMouseDown: function(e, x,y,pageIndex) onMouseDown: function(e, x,y,pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()};
},
onMouseMove: function(e, x, y, pageIndex) onMouseMove: function(e, x, y, pageIndex)
{ {
...@@ -1133,7 +1213,14 @@ function MoveInGroupState(drawingObjects, majorObject, group, startX, startY) ...@@ -1133,7 +1213,14 @@ function MoveInGroupState(drawingObjects, majorObject, group, startX, startY)
MoveInGroupState.prototype = MoveInGroupState.prototype =
{ {
onMouseDown: function(e, x, y, pageIndex) onMouseDown: function(e, x, y, pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()};
},
onMouseMove: MoveState.prototype.onMouseMove, onMouseMove: MoveState.prototype.onMouseMove,
...@@ -1207,7 +1294,14 @@ function PreRotateInGroupState(drawingObjects, group, majorObject) ...@@ -1207,7 +1294,14 @@ function PreRotateInGroupState(drawingObjects, group, majorObject)
PreRotateInGroupState.prototype = PreRotateInGroupState.prototype =
{ {
onMouseDown: function(e, x, y, pageIndex) onMouseDown: function(e, x, y, pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()};
},
onMouseMove: function(e, x, y, pageIndex) onMouseMove: function(e, x, y, pageIndex)
{ {
...@@ -1233,7 +1327,14 @@ function RotateInGroupState(drawingObjects, group, majorObject) ...@@ -1233,7 +1327,14 @@ function RotateInGroupState(drawingObjects, group, majorObject)
RotateInGroupState.prototype = RotateInGroupState.prototype =
{ {
onMouseDown: function(e, x, y, pageIndex) onMouseDown: function(e, x, y, pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()};
},
onMouseMove: RotateState.prototype.onMouseMove, onMouseMove: RotateState.prototype.onMouseMove,
...@@ -1251,7 +1352,14 @@ function PreResizeInGroupState(drawingObjects, group, majorObject, cardDirection ...@@ -1251,7 +1352,14 @@ function PreResizeInGroupState(drawingObjects, group, majorObject, cardDirection
PreResizeInGroupState.prototype = PreResizeInGroupState.prototype =
{ {
onMouseDown: function(e, x, y, pageIndex) onMouseDown: function(e, x, y, pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()};
},
onMouseMove: function(e, x, y, pageIndex) onMouseMove: function(e, x, y, pageIndex)
{ {
...@@ -1275,7 +1383,14 @@ function ResizeInGroupState(drawingObjects, group, majorObject, handleNum, cardD ...@@ -1275,7 +1383,14 @@ function ResizeInGroupState(drawingObjects, group, majorObject, handleNum, cardD
ResizeInGroupState.prototype = ResizeInGroupState.prototype =
{ {
onMouseDown: function(e, x, y, pageIndex) onMouseDown: function(e, x, y, pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()};
},
onMouseMove: ResizeState.prototype.onMouseMove, onMouseMove: ResizeState.prototype.onMouseMove,
onMouseUp: MoveInGroupState.prototype.onMouseUp onMouseUp: MoveInGroupState.prototype.onMouseUp
}; };
...@@ -1289,7 +1404,12 @@ function PreChangeAdjInGroupState(drawingObjects, group) ...@@ -1289,7 +1404,12 @@ function PreChangeAdjInGroupState(drawingObjects, group)
PreChangeAdjInGroupState.prototype = PreChangeAdjInGroupState.prototype =
{ {
onMouseDown: function(e, x, y,pageIndex) onMouseDown: function(e, x, y,pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
},
onMouseMove: function(e, x, y, pageIndex) onMouseMove: function(e, x, y, pageIndex)
{ {
...@@ -1311,7 +1431,14 @@ function ChangeAdjInGroupState(drawingObjects, group) ...@@ -1311,7 +1431,14 @@ function ChangeAdjInGroupState(drawingObjects, group)
ChangeAdjInGroupState.prototype = ChangeAdjInGroupState.prototype =
{ {
onMouseDown: function(e, x, y,pageIndex) onMouseDown: function(e, x, y,pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()};
},
onMouseMove: ChangeAdjState.prototype.onMouseMove, onMouseMove: ChangeAdjState.prototype.onMouseMove,
...@@ -1327,7 +1454,14 @@ function TextAddState(drawingObjects, majorObject) ...@@ -1327,7 +1454,14 @@ function TextAddState(drawingObjects, majorObject)
TextAddState.prototype = TextAddState.prototype =
{ {
onMouseDown: function(e, x, y, pageIndex) onMouseDown: function(e, x, y, pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_CURSOR)
return {cursorType: "default", objectId: this.majorObject.Get_Id()};
},
onMouseMove: function(e, x, y, pageIndex) onMouseMove: function(e, x, y, pageIndex)
{ {
var startPos = this.drawingObjects.startTrackPos; var startPos = this.drawingObjects.startTrackPos;
...@@ -1403,7 +1537,12 @@ function PreChangeWrapContour(drawingObjects, majorObject, pointNum) ...@@ -1403,7 +1537,12 @@ function PreChangeWrapContour(drawingObjects, majorObject, pointNum)
} }
PreChangeWrapContour.prototype.onMouseDown = function(e, x, y, pageIndex) PreChangeWrapContour.prototype.onMouseDown = function(e, x, y, pageIndex)
{}; {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
};
PreChangeWrapContour.prototype.onMouseMove = function(e, x, y, pageIndex) PreChangeWrapContour.prototype.onMouseMove = function(e, x, y, pageIndex)
{ {
this.drawingObjects.clearPreTrackObjects(); this.drawingObjects.clearPreTrackObjects();
...@@ -1427,7 +1566,12 @@ function ChangeWrapContour(drawingObjects, majorObject) ...@@ -1427,7 +1566,12 @@ function ChangeWrapContour(drawingObjects, majorObject)
ChangeWrapContour.prototype.onMouseDown = function(e, x, y, pageIndex) ChangeWrapContour.prototype.onMouseDown = function(e, x, y, pageIndex)
{}; {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
};
ChangeWrapContour.prototype.onMouseMove = function(e, x, y, pageIndex) ChangeWrapContour.prototype.onMouseMove = function(e, x, y, pageIndex)
{ {
var coords = AscFormat.CheckCoordsNeedPage(x, y, pageIndex, this.majorObject.selectStartPage); var coords = AscFormat.CheckCoordsNeedPage(x, y, pageIndex, this.majorObject.selectStartPage);
...@@ -1478,7 +1622,12 @@ function PreChangeWrapContourAddPoint(drawingObjects, majorObject, pointNum1, st ...@@ -1478,7 +1622,12 @@ function PreChangeWrapContourAddPoint(drawingObjects, majorObject, pointNum1, st
PreChangeWrapContourAddPoint.prototype = PreChangeWrapContourAddPoint.prototype =
{ {
onMouseDown: function(e, x, y, pageIndex) onMouseDown: function(e, x, y, pageIndex)
{}, {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
},
onMouseMove: function(e, x, y, pageIndex) onMouseMove: function(e, x, y, pageIndex)
{ {
...@@ -1512,7 +1661,12 @@ function ChangeWrapContourAddPoint(drawingObjects, majorObject) ...@@ -1512,7 +1661,12 @@ function ChangeWrapContourAddPoint(drawingObjects, majorObject)
ChangeWrapContourAddPoint.prototype.onMouseDown = function(e, x, y, pageIndex) ChangeWrapContourAddPoint.prototype.onMouseDown = function(e, x, y, pageIndex)
{}; {
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE){
this.onMouseUp(e, x, y, pageIndex);
this.drawingObjects.OnMouseDown(e, x, y, pageIndex);
}
};
ChangeWrapContourAddPoint.prototype.onMouseMove = function(e, x, y, pageIndex) ChangeWrapContourAddPoint.prototype.onMouseMove = function(e, x, y, pageIndex)
{ {
var coords = AscFormat.CheckCoordsNeedPage(x, y, pageIndex, this.majorObject.selectStartPage); var coords = AscFormat.CheckCoordsNeedPage(x, y, pageIndex, this.majorObject.selectStartPage);
......
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