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

Оптимизация отрисовки графики при перемещении объектов

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53457 954022d7-b5bf-4e40-9824-e11837661b57
parent ef102a0e
......@@ -2455,11 +2455,14 @@ prot["asc_getIndex"] = prot.asc_getIndex;
// Manager
//-----------------------------------------------------------------------------------
function GraphicOption(ws, type, range) {
function GraphicOption(ws, type, range, aId) {
var _this = this;
_this.ws = ws;
_this.type = type;
_this.range = range;
_this.aId = [];
if ( aId && Array.isArray(aId) )
_this.aId = aId.concat();
function checkCol(col) {
while ( (col > 0) && !_this.ws.cols[col] )
......@@ -3286,6 +3289,7 @@ function DrawingObjects() {
// Коррекция для селекта при блокировке
var delta = 4;
var boundsChecker = new CSlideBoundsChecker();
boundsChecker.objectId = graphicObject.Id;
if ( graphicObject.bounds ) {
boundsChecker.Bounds.min_x = Math.max(1, graphicObject.bounds.x - delta);
......@@ -3322,10 +3326,18 @@ function DrawingObjects() {
return null;
}
_this.clearDrawingObjects = function() {
_this.clearDrawingObjects = function(graphicOption) {
// Чистим предыдущие области
for (var i = 0; i < aBoundsCheckers.length; i++) {
var bSkip = false;
if ( graphicOption && (graphicOption.type === c_oAscGraphicOption.ChangePosition) && graphicOption.aId.length ) {
if ( graphicOption.aId.indexOf(aBoundsCheckers[i].objectId) === -1 )
bSkip = true;
}
if ( !bSkip )
_this.restoreSheetArea(aBoundsCheckers[i]);
}
aBoundsCheckers = [];
......@@ -3508,7 +3520,7 @@ function DrawingObjects() {
if ( drawingCtx ) {
if ( clearCanvas ) {
_this.clearDrawingObjects();
_this.clearDrawingObjects(graphicOption);
worksheet._drawGraphic();
}
......
......@@ -219,7 +219,8 @@ var c_oAscSelectionType = {
var c_oAscGraphicOption = {
ScrollVertical : 1,
ScrollHorizontal : 2,
AddText : 3
AddText : 3,
ChangePosition : 4
};
var c_oAscLegendMarkerType = {
......
......@@ -2853,6 +2853,7 @@ function ExtpectDoubleClickState(drawingObjectsController, drawingObjects, chart
function MoveState(drawingObjectsController, drawingObjects, startX, startY, rectX, rectY, rectW, rectH, majorObject)
{
var _this = this;
this.id = STATES_ID_MOVE;
this.drawingObjectsController = drawingObjectsController;
this.drawingObjects = drawingObjects;
......@@ -2903,10 +2904,13 @@ function MoveState(drawingObjectsController, drawingObjects, startX, startY, rec
if(bLock)
{
History.Create_NewPoint();
for(var i = 0; i < track_objects2.length; ++i)
var aId = [];
for (var i = 0; i < track_objects2.length; ++i) {
track_objects2[i].trackEnd();
drawingObjects.showDrawingObjects(true);
aId.push(track_objects2[i].originalObject.Id);
}
drawingObjects.showDrawingObjects(true, new GraphicOption(_this.drawingObjects.getWorksheet(), c_oAscGraphicOption.ChangePosition, null, aId));
//drawingObjects.showDrawingObjects(true);
}
};
this.drawingObjects.objectLocker.checkObjects(callback);
......
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