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

Fix Bug 20685 - Ограничить перемещение графических объектов кнопками клавиатуры

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50419 954022d7-b5bf-4e40-9824-e11837661b57
parent 15bdc8a1
......@@ -3070,8 +3070,8 @@ function DrawingObjects() {
// Коррекция для селекта при блокировке
var delta = 4;
boundsChecker.Bounds.min_x -= delta;
boundsChecker.Bounds.min_y -= delta;
boundsChecker.Bounds.min_x = Math.max(0, boundsChecker.Bounds.min_x - delta);
boundsChecker.Bounds.min_y = Math.max(0, boundsChecker.Bounds.min_y - delta);
boundsChecker.Bounds.max_x += delta;
boundsChecker.Bounds.max_y += delta;
return boundsChecker;
......@@ -4212,6 +4212,8 @@ function DrawingObjects() {
var top = worksheet.getCellTop(0, 3);
var left = worksheet.getCellLeft(0, 3);
var bottom = worksheet.getCellTop(worksheet.rows.length - 1, 3);
var right = worksheet.getCellLeft(worksheet.cols.length - 1, 3);
// выход за границу слева или сверху
if ( y < 0 ) {
......@@ -4224,7 +4226,7 @@ function DrawingObjects() {
}
// выход за границу справа
if ( x + w > left ) {
if ( x + w > right ) {
var foundCol = worksheet._findColUnderCursor(mmToPt(x + w), true);
while ( foundCol == null ) {
worksheet.expandColsOnScroll(true);
......@@ -4233,7 +4235,7 @@ function DrawingObjects() {
}
}
// выход за границу снизу
if ( y + h > top ) {
if ( y + h > bottom ) {
var foundRow = worksheet._findRowUnderCursor(mmToPt(y + h), true);
while ( foundRow == null ) {
worksheet.expandRowsOnScroll(true);
......
......@@ -5117,7 +5117,14 @@ function DefaultKeyDownHandle(drawingObjectsController, e)
{
var xfrm = drawingObjectsController.selectedObjects[i].spPr.xfrm;
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(drawingObjectsController.selectedObjects[i].Id, new UndoRedoDataShapeRecalc()), null);
drawingObjectsController.selectedObjects[i].setPosition(xfrm.offX - 3, xfrm.offY);
var x = xfrm.offX - 3;
var y = xfrm.offY;
var offset = drawingObjectsController.drawingObjects.checkGraphicObjectPosition(x, y, xfrm.extX, xfrm.extY);
x += offset.x;
y += offset.y;
drawingObjectsController.selectedObjects[i].setPosition(x, y);
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(drawingObjectsController.selectedObjects[i].Id, new UndoRedoDataShapeRecalc()), null);
drawingObjectsController.selectedObjects[i].recalculateTransform();
drawingObjectsController.selectedObjects[i].calculateTransformTextMatrix();
......@@ -5198,7 +5205,14 @@ function DefaultKeyDownHandle(drawingObjectsController, e)
{
var xfrm = drawingObjectsController.selectedObjects[i].spPr.xfrm;
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(drawingObjectsController.selectedObjects[i].Id, new UndoRedoDataShapeRecalc()), null);
drawingObjectsController.selectedObjects[i].setPosition(xfrm.offX, xfrm.offY - 3);
var x = xfrm.offX;
var y = xfrm.offY - 3;
var offset = drawingObjectsController.drawingObjects.checkGraphicObjectPosition(x, y, xfrm.extX, xfrm.extY);
x += offset.x;
y += offset.y;
drawingObjectsController.selectedObjects[i].setPosition(x, y);
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(drawingObjectsController.selectedObjects[i].Id, new UndoRedoDataShapeRecalc()), null);
drawingObjectsController.selectedObjects[i].recalculateTransform();
drawingObjectsController.selectedObjects[i].calculateTransformTextMatrix();
......
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