Commit 832dd52a 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@59821 954022d7-b5bf-4e40-9824-e11837661b57
parent 712d6728
......@@ -1223,73 +1223,7 @@ GraphicOption.prototype.isScrollType = function() {
};
GraphicOption.prototype.getUpdatedRange = function() {
var vr = new Asc.Range(this.ws.getFirstVisibleCol(true), this.ws.getFirstVisibleRow(true), this.ws.visibleRange.c2, this.ws.visibleRange.r2);
//var vr = _this.ws.visibleRange.clone();
if ( this.isScrollType() && !this.range )
return vr;
var checker, coords;
switch (this.type) {
case c_oAscGraphicOption.ScrollVertical:
case c_oAscGraphicOption.ScrollHorizontal: {
vr = this.range.clone();
var col = vr.c2, row;
if(col < gc_nMaxCol - 1)
++col;
if(row < gc_nMaxRow - 1)
++row;
this.checkCol(col);
this.checkRow(row);
}
break;
case c_oAscGraphicOption.AddText: {
if ( this.ws ) {
var controller = this.ws.objectRender.controller;
var selectedObjects = controller.selectedObjects;
if ( selectedObjects.length === 1 ) {
if ( selectedObjects[0].isGroup() ) {
var groupSelectedObjects = selectedObjects[0].selectedObjects;
if ( groupSelectedObjects.length === 1 ) {
checker = this.ws.objectRender.getBoundsChecker(groupSelectedObjects[0]);
coords = this.ws.objectRender.getBoundsCheckerCoords(checker);
if ( coords ) {
vr.c1 = Math.max(coords.from.col, vr.c1);
vr.r1 = Math.max(coords.from.row, vr.r1);
this.checkCol(coords.to.col + 1);
vr.c2 = Math.min(coords.to.col + 1, vr.c2);
this.checkRow(coords.to.row + 1);
vr.r2 = Math.min(coords.to.row + 1, vr.r2);
}
}
}
else {
var drawingObject = selectedObjects[0].drawingBase;
checker = this.ws.objectRender.getBoundsChecker(drawingObject.graphicObject);
coords = this.ws.objectRender.getBoundsCheckerCoords(checker);
if ( coords ) {
vr.c1 = Math.max(coords.from.col, vr.c1);
vr.r1 = Math.max(coords.from.row, vr.r1);
this.checkCol(coords.to.col + 1);
vr.c2 = Math.min(coords.to.col + 1, vr.c2);
this.checkRow(coords.to.row + 1);
vr.r2 = Math.min(coords.to.row + 1, vr.r2);
}
}
}
}
}
break;
}
return vr;
return this.range;
};
GraphicOption.prototype.getOffset = function () {
return this.offset;
......@@ -1580,11 +1514,18 @@ function DrawingObjects() {
if ( _t.isGraphicObject() && _t.graphicObject.bounds) {
var bounds = _t.graphicObject.bounds;
if ( (bounds.x < 0) || (bounds.y < 0) || (bounds.w < 0) || (bounds.h < 0) )
return;
var fromX = mmToPt(bounds.x), fromY = mmToPt(bounds.y),
var fromX = mmToPt(bounds.x > 0 ? bounds.x : 0), fromY = mmToPt(bounds.y > 0 ? bounds.y : 0),
toX = mmToPt(bounds.x + bounds.w), toY = mmToPt(bounds.y + bounds.h);
if(toX < 0)
{
toX = 0;
}
if(toY < 0)
{
toY = 0;
}
var bReinitHorScroll = false, bReinitVertScroll = false;
var fromColCell = worksheet.findCellByXY(fromX, fromY, true, false, true);
......@@ -2308,8 +2249,8 @@ function DrawingObjects() {
var x1 = worksheet.getCellLeft(updatedRange.c1, 1);// - offsetX;
var y1 = worksheet.getCellTop(updatedRange.r1, 1) ;//- offsetY;
var x2 = worksheet.getCellLeft(updatedRange.c2, 1);// - offsetX;
var y2 = worksheet.getCellTop(updatedRange.r2, 1);//- offsetY;
var x2 = worksheet.getCellLeft(updatedRange.c2, 1) + worksheet.getColumnWidth(updatedRange.c2, 1);// - offsetX;
var y2 = worksheet.getCellTop(updatedRange.r2, 1) + worksheet.getRowHeight(updatedRange.r2, 1);//- offsetY;
var w = x2 - x1;
var h = y2 - y1;
var offset = worksheet.getCellsOffset(1);
......
......@@ -561,51 +561,6 @@ CImageShape.prototype =
}
},
recalculateCursorTypes: function()
{
var transform_matrix = this.getTransformMatrix();
var transform = this.getTransform();
var hc = transform.extX*0.5;
var vc = transform.extY*0.5;
var xc = transform_matrix.TransformPointX(hc, vc);
var yc = transform_matrix.TransformPointY(hc, vc);
var xt = transform_matrix.TransformPointX(hc, 0);
var yt = transform_matrix.TransformPointY(hc, 0);
var vx = xt-xc;
var vy = yc-yt;
var angle = Math.atan2(vy, vx)+Math.PI/8;
while(angle < 0)
angle += 2*Math.PI;
while(angle >= 2*Math.PI)
angle -= 2*Math.PI;
var xlt = transform_matrix.TransformPointX(0, 0);
var ylt = transform_matrix.TransformPointY(0, 0);
var vx_lt = xlt-xc;
var vy_lt = yc-ylt;
var _index = Math.floor(angle/(Math.PI/4));
var _index2, t;
if(vx_lt*vy-vx*vy_lt < 0) // нумерация якорьков по часовой стрелке
{
for(var i = 0; i<8; ++i)
{
t = i- _index + 17;
_index2 = t - ((t/8) >> 0)*8;
this.cursorTypes[i] = DEFAULT_CURSOR_TYPES[_index2];
}
}
else
{
for(i = 0; i<8; ++i)
{
t = -i-_index+19;
_index2 = t - ((t/8) >> 0)*8;
this.cursorTypes[i] = DEFAULT_CURSOR_TYPES[_index2];
}
}
this.recalcInfo.recalculateCursorTypes = false;
},
recalculateGeometry: function()
{
if(isRealObject(this.spPr.geometry))
......
......@@ -2247,46 +2247,6 @@ CShape.prototype =
return Math.PI * 0.5 + Math.atan2(px - this.extX * 0.5, py - this.extY * 0.5);
},
recalculateCursorTypes: function () {
var transform_matrix = this.getTransformMatrix();
var transform = this.getTransformMatrix();
var hc = transform.extX * 0.5;
var vc = transform.extY * 0.5;
var xc = transform_matrix.TransformPointX(hc, vc);
var yc = transform_matrix.TransformPointY(hc, vc);
var xt = transform_matrix.TransformPointX(hc, 0);
var yt = transform_matrix.TransformPointY(hc, 0);
var vx = xt - xc;
var vy = yc - yt;
var angle = Math.atan2(vy, vx) + Math.PI / 8;
while (angle < 0)
angle += 2 * Math.PI;
while (angle >= 2 * Math.PI)
angle -= 2 * Math.PI;
var xlt = transform_matrix.TransformPointX(0, 0);
var ylt = transform_matrix.TransformPointY(0, 0);
var vx_lt = xlt - xc;
var vy_lt = yc - ylt;
var _index = Math.floor(angle / (Math.PI / 4));
var _index2, t;
if (vx_lt * vy - vx * vy_lt < 0) // нумерация якорьков по часовой стрелке
{
for (var i = 0; i < 8; ++i) {
t = i - _index + 17;
_index2 = t - ((t / 8) >> 0) * 8;
this.cursorTypes[i] = DEFAULT_CURSOR_TYPES[_index2];
}
}
else {
for (i = 0; i < 8; ++i) {
t = -i - _index + 19;
_index2 = t - ((t / 8) >> 0) * 8;
this.cursorTypes[i] = DEFAULT_CURSOR_TYPES[_index2];
}
}
this.recalcInfo.recalculateCursorTypes = false;
},
recalculateGeometry: function () {
if (this.spPr && isRealObject(this.spPr.geometry)) {
......
......@@ -2732,7 +2732,19 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
spreadsheet_api.prototype.asyncImageEndLoadedBackground = function() {
var worksheet = this.wb.getWorksheet();
worksheet && worksheet.objectRender.showDrawingObjects(false, new GraphicOption(worksheet, c_oAscGraphicOption.ScrollVertical, worksheet.getVisibleRange(), null, {offsetX: 0, offsetY: 0}));
if(worksheet && worksheet.objectRender)
{
var drawing_area = worksheet.objectRender.drawingArea;
if(drawing_area)
{
for(var i = 0; i < drawing_area.frozenPlaces.length; ++i)
{
worksheet.objectRender.showDrawingObjects(false, new GraphicOption(worksheet, c_oAscGraphicOption.ScrollVertical, drawing_area.frozenPlaces[i].range, null, {offsetX: 0, offsetY: 0}));
}
}
}
};
// Frozen pane
......
......@@ -357,10 +357,7 @@ CShape.prototype.recalculate = function ()
if (this.recalcInfo.recalculateTransformText) {
this.recalculateTransformText();
}
if (this.recalcInfo.recalculateCursorTypes) {
this.recalculateCursorTypes();
this.recalcInfo.recalculateCursorTypes = false;
}
if(this.recalcInfo.recalculateBounds)
{
this.recalculateBounds();
......
......@@ -445,10 +445,6 @@ CShape.prototype.recalculate = function ()
this.recalcInfo.recalculateTransformText = false;
this.clipRect = null;
}
// if (this.recalcInfo.recalculateCursorTypes) {
// this.recalculateCursorTypes();
// this.recalcInfo.recalculateCursorTypes = false;
// }
if(this.recalcInfo.recalculateBounds)
{
this.recalculateBounds();
......
......@@ -305,11 +305,6 @@ CShape.prototype.recalculate = function ()
this.recalcInfo.recalculateGeometry = false;
}
if (this.recalcInfo.recalculateCursorTypes) {
this.recalculateCursorTypes();
this.recalcInfo.recalculateCursorTypes = false;
}
if(this.recalcInfo.recalculateBounds)
{
this.recalculateBounds();
......
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