Commit 09a14fad authored by Dmitry.Vikulov's avatar Dmitry.Vikulov

- Add changeZoom(DrawingObjects.js)

- Инициализация shapeCtx и shapeOverlayCtx в WorkbookView

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47848 954022d7-b5bf-4e40-9824-e11837661b57
parent 36adaf18
...@@ -2099,9 +2099,7 @@ function DrawingObjects() { ...@@ -2099,9 +2099,7 @@ function DrawingObjects() {
drawingCtx = currentSheet.drawingCtx; drawingCtx = currentSheet.drawingCtx;
overlayCtx = currentSheet.overlayCtx; overlayCtx = currentSheet.overlayCtx;
shapeCtx = currentSheet.shapeCtx; shapeCtx = currentSheet.shapeCtx;
shapeCtx.m_oFontManager = api.wb.fmgrGraphics[2];
shapeOverlayCtx = currentSheet.shapeOverlayCtx; shapeOverlayCtx = currentSheet.shapeOverlayCtx;
shapeOverlayCtx.m_oFontManager = api.wb.fmgrGraphics[2];
trackOverlay = new COverlay(); trackOverlay = new COverlay();
trackOverlay.init( shapeOverlayCtx.m_oContext, "ws-canvas-overlay", 0, 0, shapeOverlayCtx.m_lWidthPix, shapeOverlayCtx.m_lHeightPix, shapeOverlayCtx.m_dWidthMM, shapeOverlayCtx.m_dHeightMM ); trackOverlay.init( shapeOverlayCtx.m_oContext, "ws-canvas-overlay", 0, 0, shapeOverlayCtx.m_lWidthPix, shapeOverlayCtx.m_lHeightPix, shapeOverlayCtx.m_dWidthMM, shapeOverlayCtx.m_dHeightMM );
...@@ -2142,13 +2140,11 @@ function DrawingObjects() { ...@@ -2142,13 +2140,11 @@ function DrawingObjects() {
} }
} }
_this.getOverlay = function() _this.getOverlay = function() {
{
return trackOverlay; return trackOverlay;
}; };
_this.OnUpdateOverlay = function() _this.OnUpdateOverlay = function() {
{
/*if (this.IsUpdateOverlayOnlyEnd) /*if (this.IsUpdateOverlayOnlyEnd)
{ {
this.IsUpdateOverlayOnEndCheck = true; this.IsUpdateOverlayOnEndCheck = true;
...@@ -2282,6 +2278,9 @@ function DrawingObjects() { ...@@ -2282,6 +2278,9 @@ function DrawingObjects() {
return true; return true;
}; };
_this.changeZoom = function(factor) {
}
_this.getWorkbook = function() { _this.getWorkbook = function() {
return (worksheet ? worksheet.model.workbook : null); return (worksheet ? worksheet.model.workbook : null);
} }
......
...@@ -133,6 +133,15 @@ ...@@ -133,6 +133,15 @@
this.buffers.overlay = asc_DC({canvas: this.canvasOverlay[0], units: 1/*pt*/, fmgrGraphics: this.fmgrGraphics}); this.buffers.overlay = asc_DC({canvas: this.canvasOverlay[0], units: 1/*pt*/, fmgrGraphics: this.fmgrGraphics});
this.drawingCtx = this.buffers.main; this.drawingCtx = this.buffers.main;
this.overlayCtx = this.buffers.overlay; this.overlayCtx = this.buffers.overlay;
// Shapes
this.buffers.shapeCtx = new CGraphics();
this.buffers.shapeCtx.init(this.drawingCtx.ctx, this.drawingCtx.getWidth(0), this.drawingCtx.getHeight(0), this.drawingCtx.getWidth(3), this.drawingCtx.getHeight(3));
this.buffers.shapeCtx.m_oFontManager = this.fmgrGraphics[2];
this.buffers.shapeOverlayCtx = new CGraphics();
this.buffers.shapeOverlayCtx.init(this.overlayCtx.ctx, this.overlayCtx.getWidth(0), this.overlayCtx.getHeight(0), this.overlayCtx.getWidth(3), this.overlayCtx.getHeight(3));
this.buffers.shapeOverlayCtx.m_oFontManager = this.fmgrGraphics[2];
this.drawingCtxCharts = asc_DC({units: 1/*pt*/, fmgrGraphics: this.fmgrGraphics}); this.drawingCtxCharts = asc_DC({units: 1/*pt*/, fmgrGraphics: this.fmgrGraphics});
...@@ -1070,6 +1079,7 @@ ...@@ -1070,6 +1079,7 @@
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();
......
...@@ -370,10 +370,8 @@ ...@@ -370,10 +370,8 @@
this.buffers = buffers; this.buffers = buffers;
this.drawingCtx = this.buffers.main; this.drawingCtx = this.buffers.main;
this.overlayCtx = this.buffers.overlay; this.overlayCtx = this.buffers.overlay;
this.shapeCtx = new CGraphics(); this.shapeCtx = this.buffers.shapeCtx;
this.shapeCtx.init(this.drawingCtx.ctx, this.drawingCtx.getWidth(0), this.drawingCtx.getHeight(0), this.drawingCtx.getWidth(3), this.drawingCtx.getHeight(3)); this.shapeOverlayCtx = this.buffers.shapeOverlayCtx;
this.shapeOverlayCtx = new CGraphics();
this.shapeOverlayCtx.init(this.overlayCtx.ctx, this.overlayCtx.getWidth(0), this.overlayCtx.getHeight(0), this.overlayCtx.getWidth(3), this.overlayCtx.getHeight(3));
this.stringRender = stringRender; this.stringRender = stringRender;
...@@ -629,6 +627,7 @@ ...@@ -629,6 +627,7 @@
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.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.shapeOverlayCtx.init(this.overlayCtx.ctx, this.overlayCtx.getWidth(0), this.overlayCtx.getHeight(0), this.overlayCtx.getWidth(3), this.overlayCtx.getHeight(3));
...@@ -638,6 +637,11 @@ ...@@ -638,6 +637,11 @@
} }
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);
......
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