Commit 52e4d8db authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47575 954022d7-b5bf-4e40-9824-e11837661b57
parent 70eb6fa2
......@@ -146,26 +146,30 @@ DrawingObjectsController.prototype =
var hit_to_adj = selected_objects[0].hitToAdjustment(x, y);
if(hit_to_adj.hit)
{
return selected_objects[0].drawingBase.id;
return {objectId: selected_objects[0].drawingBase.id, cursorType: "crosshair"};
}
}
for(var i = selected_objects.length - 1; i > -1; --i)
{
var hit_to_handles = selected_objects[i].hitToHandles(x, y);
var cursor_type;
if(hit_to_handles > -1)
{
if(hit_to_handles === 8)
{
if(!selected_objects[i].canRotate())
return null;
cursor_type = "crosshair";
}
else
{
if(!selected_objects[i].canResize())
return null;
cursor_type = CURSOR_TYPES_BY_CARD_DIRECTION[selected_objects[i].getCardDirectionByNum(hit_to_handles)];
}
return selected_objects[i].drawingBase.id;
return {objectId: selected_objects[i].drawingBase.id, cursorType: cursor_type};
}
}
......@@ -173,7 +177,7 @@ DrawingObjectsController.prototype =
{
if(selected_objects[i].hitInBoundingRect(x, y))
{
return selected_objects[i].canMove() ? selected_objects[i].drawingBase.id : null;
return {objectId: selected_objects[i].drawingBase.id, cursorType: "move"};
}
}
......@@ -191,7 +195,7 @@ DrawingObjectsController.prototype =
var hit_in_text_rect = cur_drawing.hitInTextRect(x, y);
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path)
{
return cur_drawing.canMove() ? cur_drawing_base.id : null;
return {objectId: cur_drawing_base.id , cursorType: "move"};
}
else if(hit_in_text_rect)
{
......@@ -205,6 +209,5 @@ DrawingObjectsController.prototype =
}
}
return null;
}
};
\ No newline at end of file
......@@ -18,6 +18,17 @@ var CARD_DIRECTION_SW = 5;
var CARD_DIRECTION_W = 6;
var CARD_DIRECTION_NW = 7;
var CURSOR_TYPES_BY_CARD_DIRECTION = [];
CURSOR_TYPES_BY_CARD_DIRECTION[CARD_DIRECTION_N] = "n-resize";
CURSOR_TYPES_BY_CARD_DIRECTION[CARD_DIRECTION_NE] = "ne-resize";
CURSOR_TYPES_BY_CARD_DIRECTION[CARD_DIRECTION_E] = "e-resize";
CURSOR_TYPES_BY_CARD_DIRECTION[CARD_DIRECTION_SE] = "se-resize";
CURSOR_TYPES_BY_CARD_DIRECTION[CARD_DIRECTION_S] = "s-resize";
CURSOR_TYPES_BY_CARD_DIRECTION[CARD_DIRECTION_SW] = "sw-resize";
CURSOR_TYPES_BY_CARD_DIRECTION[CARD_DIRECTION_W] = "w-resize";
CURSOR_TYPES_BY_CARD_DIRECTION[CARD_DIRECTION_NW] = "nw-resize";
function isRealNumber(number)
{
return number === number && typeof number === "number";
......
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