Commit 772acfe0 authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

Доработки для move/resize

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47576 954022d7-b5bf-4e40-9824-e11837661b57
parent 52e4d8db
......@@ -3272,8 +3272,10 @@ function DrawingObjects() {
_this.addGraphicObject = function(x, y, extX, extY, flipH, flipV, presetGeom) {
var obj = _this.createDrawingObject();
obj.id = generateId();
obj.graphicObject = new CShape(obj);
obj.graphicObject.initDefault(x, y, extX, extY, flipH, flipV, presetGeom);
obj.graphicObject.select(_this.controller);
aObjects.push(obj);
_this.showDrawingObjects(false);
}
......@@ -4460,9 +4462,22 @@ function DrawingObjects() {
}
_this.checkCursorDrawingObject = function(x, y) {
if ( !aObjects.length )
return null;
var index = _this.inSelectionDrawingObjectIndex(x, y, true);
var objectInfo = { cursor: null, data: null };
var objectInfo = { cursor: null, data: null, isShape: false };
var asc = window["Asc"];
var graphicObjectInfo = _this.controller.isPointInDrawingObjects( pxToMm(x), pxToMm(y) );
if ( graphicObjectInfo ) {
objectInfo.data = graphicObjectInfo.objectId;
objectInfo.cursor = graphicObjectInfo.cursorType;
objectInfo.isShape = true;
return objectInfo;
}
if (index >= 0) {
var eps = 6;
......
......@@ -155,6 +155,7 @@
<script src="model/DrawingObjects/Tracks/ResizeTracks.js"></script>
<script src="model/DrawingObjects/Tracks/RotateTracks.js"></script>
<script src="model/DrawingObjects/Tracks/NewShapeTracks.js"></script>
<script src="model/DrawingObjects/Tracks/MoveTracks.js"></script>
<script src="model/DrawingObjects/Hit.js"></script>
<style type="text/css">
......
......@@ -562,7 +562,7 @@ CShape.prototype =
var x_t = invert_transform.TransformPointX(x, y);
var y_t = invert_transform.TransformPointY(x, y);
var _hit_context = his.drawingBase.getCanvasContext();
var _hit_context = this.drawingBase.getCanvasContext();
return (HitInLine(_hit_context, x_t, y_t, 0, 0, this.extX, 0) ||
HitInLine(_hit_context, x_t, y_t, this.extX, 0, this.extX, this.extY)||
......
......@@ -91,7 +91,7 @@ function NullState(drawingObjectsController, drawingObjects)
{
this.drawingObjectsController.addPreTrackObject(selected_objects[j].createMoveTrack());
}
this.drawingObjectsController.changeCurrentState(new PreMoveState(this.drawingObjectsController, this.drawingObjects, x, y, e.shiftKey, e.ctrl, selected_objects[j].isGroup() ? selected_objects[j] : null));
this.drawingObjectsController.changeCurrentState(new PreMoveState(this.drawingObjectsController, this.drawingObjects, x, y, e.shiftKey, e.ctrl, selected_objects[i].isGroup() ? selected_objects[i] : null));
return;
}
}
......@@ -116,7 +116,7 @@ function NullState(drawingObjectsController, drawingObjects)
{
this.drawingObjectsController.addPreTrackObject(selected_objects[j].createMoveTrack());
}
this.changeCurrentState(new PreMoveState(this.drawingObjectsController, this.drawingObjects,x, y, e.shiftKey, e.ctrl, cur_drawing.isGroup() ? cur_drawing : null));
this.drawingObjectsController.changeCurrentState(new PreMoveState(this.drawingObjectsController, this.drawingObjects,x, y, e.shiftKey, e.ctrl, cur_drawing.isGroup() ? cur_drawing : null));
return;
}
else if(hit_in_text_rect)
......
......@@ -28,7 +28,7 @@ function MoveShapeImageTrack(originalObject)
global_MatrixTransformer.ScaleAppend(this.transform, -1, 1);
if(original.flipV)
global_MatrixTransformer.ScaleAppend(this.transform, 1, -1);
global_MatrixTransformer.RotateAppend(this.transform, original.rot);
global_MatrixTransformer.RotateRadAppend(this.transform, original.rot);
global_MatrixTransformer.TranslateAppend(this.transform, this.x + hc, this.y + vc);
};
......
......@@ -5912,8 +5912,18 @@
this.objectRender.saveUndoRedoDrawingObject();
//return ret;
}
var drawingInfo = this.objectRender.checkCursorDrawingObject(x, y);
if ( drawingInfo ) {
if ( drawingInfo.isShape )
asc.editor.isStartAddShape = true;
else
asc.editor.isStartAddShape = false;
}
// move active range to coordinates x,y
this._moveActiveCellToXY(x, y);
} else {
// move active range to offset x,y
this._moveActiveCellToOffset(x, y);
......
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