Commit 78a6174b 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@53373 954022d7-b5bf-4e40-9824-e11837661b57
parent 0a11c220
......@@ -5480,7 +5480,7 @@ function DrawGroupSelection(group, drawingDocument)
var group_selected_objects = group.selectedObjects;
for(var i = 0; i < group_selected_objects.length; ++i)
{
drawingDocument.DrawTrack(TYPE_TRACK_SHAPE, group_selected_objects[i].getTransformMatrix(), 0, 0, group_selected_objects[i].extX, group_selected_objects[i].extY, false, group_selected_objects[i].canRotate())
drawingDocument.DrawTrack(TYPE_TRACK_SHAPE, group_selected_objects[i].getTransformMatrix(), 0, 0, group_selected_objects[i].extX, group_selected_objects[i].extY, CheckObjectLine(group_selected_objects[i]), group_selected_objects[i].canRotate())
}
if(group_selected_objects.length === 1)
{
......
......@@ -107,15 +107,19 @@ function NewShapeTrack(drawingObjects, presetGeom, startX, startY)
this.flipV = true;
}
}
if(!(e.CtrlKey || e.ShiftKey))
if(!(e.CtrlKey || e.ShiftKey) || (e.CtrlKey && !e.ShiftKey && this.isLine))
{
this.extX = abs_dist_x >= MIN_SHAPE_SIZE ? abs_dist_x : (this.isLine ? 0 : MIN_SHAPE_SIZE);
this.extY = abs_dist_y >= MIN_SHAPE_SIZE ? abs_dist_y : (this.isLine ? 0 : MIN_SHAPE_SIZE);
if(real_dist_x >= 0)
{
this.x = this.startX;
}
else
{
this.x = abs_dist_x >= MIN_SHAPE_SIZE || this.isLine ? x : this.startX - MIN_SHAPE_SIZE;
this.x = abs_dist_x >= MIN_SHAPE_SIZE ? x : this.startX - this.extX;
}
if(real_dist_y >= 0)
......@@ -124,16 +128,12 @@ function NewShapeTrack(drawingObjects, presetGeom, startX, startY)
}
else
{
this.y = abs_dist_y >= MIN_SHAPE_SIZE || this.isLine ? y : this.startY - MIN_SHAPE_SIZE;
this.y = abs_dist_y >= MIN_SHAPE_SIZE ? y : this.startY - this.extY;
}
this.extX = abs_dist_x >= MIN_SHAPE_SIZE ? abs_dist_x : MIN_SHAPE_SIZE;
this.extY = abs_dist_y >= MIN_SHAPE_SIZE ? abs_dist_y : MIN_SHAPE_SIZE;
}
else if(e.CtrlKey && !e.ShiftKey)
{
if(abs_dist_x >= MIN_SHAPE_SIZE_DIV2 || this.isLine)
if(abs_dist_x >= MIN_SHAPE_SIZE_DIV2 )
{
this.x = this.startX - abs_dist_x;
this.extX = 2*abs_dist_x;
......@@ -144,7 +144,7 @@ function NewShapeTrack(drawingObjects, presetGeom, startX, startY)
this.extX = MIN_SHAPE_SIZE;
}
if(abs_dist_y >= MIN_SHAPE_SIZE_DIV2 || this.isLine)
if(abs_dist_y >= MIN_SHAPE_SIZE_DIV2 )
{
this.y = this.startY - abs_dist_y;
this.extY = 2*abs_dist_y;
......
......@@ -215,8 +215,10 @@ function ResizeTrackShapeImage(originalObject, cardDirection)
_real_width = this.usedExtX*kd1;
_abs_width = Math.abs(_real_width);
this.resizedExtX = _abs_width >= MIN_SHAPE_SIZE || this.isLine ? _abs_width : MIN_SHAPE_SIZE;
if(_real_width < 0)
if(_real_width < 0 )
{
this.resizedflipH = !this.originalFlipH;
}
else
this.resizedflipH = this.originalFlipH;
}
......@@ -230,10 +232,22 @@ function ResizeTrackShapeImage(originalObject, cardDirection)
_real_height = this.usedExtY*kd2;
_abs_height = Math.abs(_real_height);
this.resizedExtY = _abs_height >= MIN_SHAPE_SIZE || this.isLine ? _abs_height : MIN_SHAPE_SIZE;
if(_real_height < 0)
if(_real_height < 0 )
{
this.resizedflipV = !this.originalFlipV;
if(this.isLine && ShiftKey)
{
this.resizedflipH = !this.originalFlipH;
}
}
else
{
this.resizedflipV = this.originalFlipV;
if(this.isLine && ShiftKey && this.resizedflipH !== this.originalFlipH)
{
this.resizedflipV = !this.originalFlipV;
}
}
_new_resize_half_width = this.resizedExtX*0.5;
......@@ -271,7 +285,7 @@ function ResizeTrackShapeImage(originalObject, cardDirection)
_real_height = this.usedExtY*kd2;
_abs_height = Math.abs(_real_height);
this.resizedExtY = _abs_height >= MIN_SHAPE_SIZE || this.isLine ? _abs_height : MIN_SHAPE_SIZE;
if(_real_height < 0)
if(_real_height < 0 )
this.resizedflipV = !this.originalFlipV;
else
this.resizedflipV = this.originalFlipV;
......@@ -280,10 +294,22 @@ function ResizeTrackShapeImage(originalObject, cardDirection)
_real_width = this.usedExtX*kd1;
_abs_width = Math.abs(_real_width);
this.resizedExtX = _abs_width >= MIN_SHAPE_SIZE || this.isLine ? _abs_width : MIN_SHAPE_SIZE;
if(_real_width < 0)
if(_real_width < 0 )
{
this.resizedflipH = !this.originalFlipH;
if(this.isLine && ShiftKey)
{
this.resizedflipV = !this.originalFlipV;
}
}
else
{
this.resizedflipH = this.originalFlipH;
if(this.isLine && ShiftKey && this.resizedflipV !== this.originalFlipV)
{
this.resizedflipH = !this.originalFlipH;
}
}
_new_resize_half_width = this.resizedExtX*0.5;
......@@ -320,7 +346,7 @@ function ResizeTrackShapeImage(originalObject, cardDirection)
_real_width = this.usedExtX*kd1;
_abs_width = Math.abs(_real_width);
this.resizedExtX = _abs_width >= MIN_SHAPE_SIZE || this.isLine ? _abs_width : MIN_SHAPE_SIZE;
if(_real_width < 0)
if(_real_width < 0 )
this.resizedflipH = !this.originalFlipH;
else
this.resizedflipH = this.originalFlipH;
......@@ -335,10 +361,22 @@ function ResizeTrackShapeImage(originalObject, cardDirection)
_real_height = this.usedExtY*kd2;
_abs_height = Math.abs(_real_height);
this.resizedExtY = _abs_height >= MIN_SHAPE_SIZE || this.isLine ? _abs_height : MIN_SHAPE_SIZE;
if(_real_height < 0)
if(_real_height < 0 )
{
this.resizedflipV = !this.originalFlipV;
if(this.isLine && ShiftKey)
{
this.resizedflipH = !this.originalFlipH;
}
}
else
{
this.resizedflipV = this.originalFlipV;
if(this.isLine && ShiftKey && this.resizedflipH !== this.originalFlipH)
{
this.resizedflipV = !this.originalFlipV;
}
}
_new_resize_half_width = this.resizedExtX*0.5;
_new_resize_half_height = this.resizedExtY*0.5;
......@@ -374,7 +412,7 @@ function ResizeTrackShapeImage(originalObject, cardDirection)
_real_height = this.usedExtY*kd1;
_abs_height = Math.abs(_real_height);
this.resizedExtY = _abs_height >= MIN_SHAPE_SIZE || this.isLine ? _abs_height : MIN_SHAPE_SIZE;
if(_real_height < 0)
if(_real_height < 0 )
this.resizedflipV = !this.originalFlipV;
else
this.resizedflipV = this.originalFlipV;
......@@ -389,10 +427,22 @@ function ResizeTrackShapeImage(originalObject, cardDirection)
_real_width = this.usedExtX*kd2;
_abs_width = Math.abs(_real_width);
this.resizedExtX = _abs_width >= MIN_SHAPE_SIZE || this.isLine ? _abs_width : MIN_SHAPE_SIZE;
if(_real_width < 0)
if(_real_width < 0 )
{
this.resizedflipH = !this.originalFlipH;
if(this.isLine && ShiftKey)
{
this.resizedflipV = !this.originalFlipV;
}
}
else
{
this.resizedflipH = this.originalFlipH;
if(this.isLine && ShiftKey && this.resizedflipV !== this.originalFlipV)
{
this.resizedflipH = !this.originalFlipH;
}
}
_new_resize_half_width = this.resizedExtX*0.5;
_new_resize_half_height = this.resizedExtY*0.5;
......@@ -449,6 +499,11 @@ function ResizeTrackShapeImage(originalObject, cardDirection)
this.resizeRelativeCenter = function(kd1, kd2, ShiftKey)
{
if(this.isLine)
{
this.resize(kd1, kd2, ShiftKey);
return;
}
kd1 = 2*kd1 - 1;
kd2 = 2*kd2 - 1;
var _real_height, _real_width;
......
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