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

Shapes:

- zoom
- scroll
- insert image by coords

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48005 954022d7-b5bf-4e40-9824-e11837661b57
parent ae7f6253
...@@ -2858,6 +2858,16 @@ function DrawingObjects() { ...@@ -2858,6 +2858,16 @@ function DrawingObjects() {
}; };
_this.changeZoom = function(factor) { _this.changeZoom = function(factor) {
shapeCtx.init( drawingCtx.ctx, drawingCtx.getWidth(0), drawingCtx.getHeight(0), drawingCtx.getWidth(3), drawingCtx.getHeight(3) );
shapeCtx.CalculateFullTransform();
shapeOverlayCtx.init( overlayCtx.ctx, overlayCtx.getWidth(0), overlayCtx.getHeight(0), overlayCtx.getWidth(3), overlayCtx.getHeight(3) );
shapeOverlayCtx.CalculateFullTransform();
trackOverlay.init( shapeOverlayCtx.m_oContext, "ws-canvas-overlay", 0, 0, shapeOverlayCtx.m_lWidthPix, shapeOverlayCtx.m_lHeightPix, shapeOverlayCtx.m_dWidthMM, shapeOverlayCtx.m_dHeightMM );
autoShapeTrack.init( trackOverlay, 0, 0, shapeOverlayCtx.m_lWidthPix, shapeOverlayCtx.m_lHeightPix, shapeOverlayCtx.m_dWidthMM, shapeOverlayCtx.m_dHeightMM );
autoShapeTrack.Graphics.CalculateFullTransform();
} }
_this.getWorkbook = function() { _this.getWorkbook = function() {
...@@ -3171,6 +3181,7 @@ function DrawingObjects() { ...@@ -3171,6 +3181,7 @@ function DrawingObjects() {
_this.raiseLayerDrawingObjects(true); _this.raiseLayerDrawingObjects(true);
} }
} }
_this.drawWorksheetHeaders();
} }
_this.showOverlayGraphicObjects = function() { _this.showOverlayGraphicObjects = function() {
...@@ -3247,6 +3258,11 @@ function DrawingObjects() { ...@@ -3247,6 +3258,11 @@ function DrawingObjects() {
return metrics; return metrics;
} }
_this.drawWorksheetHeaders = function() {
worksheet._drawColumnHeaders();
worksheet._drawRowHeaders();
}
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// Common operation for Undo/Redo // Common operation for Undo/Redo
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
...@@ -3335,8 +3351,8 @@ function DrawingObjects() { ...@@ -3335,8 +3351,8 @@ function DrawingObjects() {
calculateObjectMetrics(obj, isOption ? options.width : _image.Image.width, isOption ? options.height : _image.Image.height); calculateObjectMetrics(obj, isOption ? options.width : _image.Image.width, isOption ? options.height : _image.Image.height);
var x = pxToMm(obj.getVisibleLeftOffset() + headerLeft); var x = pxToMm(obj.getRealLeftOffset());
var y = pxToMm(obj.getVisibleTopOffset() + headerTop); var y = pxToMm(obj.getRealTopOffset());
var w = pxToMm(obj.getWidthFromTo()); var w = pxToMm(obj.getWidthFromTo());
var h = pxToMm(obj.getHeightFromTo()); var h = pxToMm(obj.getHeightFromTo());
...@@ -3350,10 +3366,6 @@ function DrawingObjects() { ...@@ -3350,10 +3366,6 @@ function DrawingObjects() {
worksheet.cellCommentator.drawCommentCells(false); worksheet.cellCommentator.drawCommentCells(false);
_this.showDrawingObjects(false); _this.showDrawingObjects(false);
// History.Create_NewPoint();
// History.Add(g_oUndoRedoDrawingObject, historyitem_DrawingObject_Add, worksheet.model.getId(), null, obj);
_this.lockDrawingObject(obj.id, bPackage ? false : true, bPackage ? false : true); _this.lockDrawingObject(obj.id, bPackage ? false : true, bPackage ? false : true);
} }
...@@ -4065,6 +4077,7 @@ function DrawingObjects() { ...@@ -4065,6 +4077,7 @@ function DrawingObjects() {
graphic.setDrawingBase(obj); graphic.setDrawingBase(obj);
obj.graphicObject.select(_this.controller); obj.graphicObject.select(_this.controller);
obj.setGraphicObjectCoords();
aObjects.push(obj); aObjects.push(obj);
_this.showDrawingObjects(false); _this.showDrawingObjects(false);
worksheet.model.workbook.handlers.trigger("asc_onEndAddShape"); worksheet.model.workbook.handlers.trigger("asc_onEndAddShape");
...@@ -4175,8 +4188,10 @@ function DrawingObjects() { ...@@ -4175,8 +4188,10 @@ function DrawingObjects() {
} }
_this.selectGraphicObject = function() { _this.selectGraphicObject = function() {
if ( _this.drawingDocument ) if ( _this.drawingDocument ) {
_this.controller.drawSelection(_this.drawingDocument); _this.controller.drawSelection(_this.drawingDocument);
_this.drawWorksheetHeaders();
}
} }
_this.setScrollOffset = function(x_px, y_px) { _this.setScrollOffset = function(x_px, y_px) {
......
...@@ -1080,10 +1080,10 @@ ...@@ -1080,10 +1080,10 @@
item = this.wsViews[i]; item = this.wsViews[i];
// Меняем zoom (для не активных сменим как только сделаем его активным) // Меняем zoom (для не активных сменим как только сделаем его активным)
item.changeZoom(/*isDraw*/i == activeIndex); item.changeZoom(/*isDraw*/i == activeIndex);
item.graphicsChangeZoom(/*isDraw*/i == activeIndex, factor);
if (i == activeIndex) { if (i == activeIndex) {
item.draw(); item.draw();
item.drawDepCells(); item.drawDepCells();
item.objectRender.changeZoom(this.drawingCtx.scaleFactor);
} }
} }
} }
......
...@@ -627,10 +627,6 @@ ...@@ -627,10 +627,6 @@
this._prepareCellTextMetricsCache(this.visibleRange); this._prepareCellTextMetricsCache(this.visibleRange);
this._shiftVisibleRange(); this._shiftVisibleRange();
this.cellCommentator.updateCommentPosition(); this.cellCommentator.updateCommentPosition();
this.shapeCtx.init(this.drawingCtx.ctx, this.drawingCtx.getWidth(0), this.drawingCtx.getHeight(0), this.drawingCtx.getWidth(3), this.drawingCtx.getHeight(3));
this.shapeOverlayCtx.init(this.overlayCtx.ctx, this.overlayCtx.getWidth(0), this.overlayCtx.getHeight(0), this.overlayCtx.getWidth(3), this.overlayCtx.getHeight(3));
this.updateZoom = false; this.updateZoom = false;
} else { } else {
this.updateZoom = true; this.updateZoom = true;
...@@ -638,11 +634,6 @@ ...@@ -638,11 +634,6 @@
return this; return this;
}, },
graphicsChangeZoom: function (isUpdate, factor) {
if ( isUpdate )
this.objectRender.changeZoom(factor);
},
getCellTextMetrics: function (col, row) { getCellTextMetrics: function (col, row) {
var ct = this._getCellTextCache(col, row); var ct = this._getCellTextCache(col, row);
return ct ? $.extend({}, ct.metrics) : undefined; return ct ? $.extend({}, ct.metrics) : undefined;
......
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