Commit 70db09cd authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Bug 31182 - Смещение изображений при изменении размера окна браузера

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@67175 954022d7-b5bf-4e40-9824-e11837661b57
parent 5497454f
......@@ -1086,14 +1086,23 @@ function DrawingObjects() {
_this.resizeCanvas = function() {
_this.drawingArea.init();
shapeCtx.init( drawingCtx.ctx, drawingCtx.getWidth(0), drawingCtx.getHeight(0), drawingCtx.getWidth(3), drawingCtx.getHeight(3) );
var canvasWidth = drawingCtx.canvas.width;
var canvasHeight = drawingCtx.canvas.height;
shapeCtx.init( drawingCtx.ctx, canvasWidth, canvasHeight, (canvasWidth*25.4/drawingCtx.ppiX), (canvasHeight*25.4/drawingCtx.ppiY));
shapeCtx.CalculateFullTransform();
shapeOverlayCtx.init( overlayCtx.ctx, overlayCtx.getWidth(0), overlayCtx.getHeight(0), overlayCtx.getWidth(3), overlayCtx.getHeight(3) );
var overlayWidth = overlayCtx.canvas.width;
var overlayHeight = overlayCtx.canvas.height;
shapeOverlayCtx.init( overlayCtx.ctx, overlayWidth, overlayHeight, (overlayWidth*25.4/overlayCtx.ppiX), (overlayHeight*25.4/overlayCtx.ppiY));
shapeOverlayCtx.CalculateFullTransform();
trackOverlay.init( shapeOverlayCtx.m_oContext, "ws-canvas-graphic-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 );
trackOverlay.init( shapeOverlayCtx.m_oContext, "ws-canvas-graphic-overlay", 0, 0, overlayWidth, overlayHeight, (overlayWidth*25.4/overlayCtx.ppiX), (overlayHeight*25.4/overlayCtx.ppiY));
autoShapeTrack.init( trackOverlay, 0, 0, overlayWidth, overlayHeight, (overlayWidth*25.4/overlayCtx.ppiX), (overlayHeight*25.4/overlayCtx.ppiY) );
autoShapeTrack.Graphics.CalculateFullTransform();
};
......
......@@ -755,8 +755,8 @@ CAutoshapeTrack.prototype =
var wDst = drPage.right - drPage.left;
var hDst = drPage.bottom - drPage.top;
var dKoefX = wDst / this.CurrentPageInfo.width_mm;
var dKoefY = hDst / this.CurrentPageInfo.height_mm;
var dKoefX = (this.Graphics ? this.Graphics.m_oCoordTransform.sx : wDst / this.CurrentPageInfo.width_mm);
var dKoefY = (this.Graphics ? this.Graphics.m_oCoordTransform.sy : hDst / this.CurrentPageInfo.height_mm);
var r = left + width;
var b = top + height;
......
......@@ -261,12 +261,19 @@
this._canResize();
// Shapes
var canvasWidth = this.drawingGraphicCtx.canvas.width;
var canvasHeight = this.drawingGraphicCtx.canvas.height;
this.buffers.shapeCtx = new CGraphics();
this.buffers.shapeCtx.init(this.drawingGraphicCtx.ctx, this.drawingGraphicCtx.getWidth(0), this.drawingGraphicCtx.getHeight(0), this.drawingGraphicCtx.getWidth(3), this.drawingGraphicCtx.getHeight(3));
this.buffers.shapeCtx.init(this.drawingGraphicCtx.ctx, canvasWidth, canvasHeight, (canvasWidth*25.4/this.drawingGraphicCtx.ppiX), (canvasHeight*25.4/this.drawingGraphicCtx.ppiY));
this.buffers.shapeCtx.m_oFontManager = this.fmgrGraphics[2];
var overlayWidth = this.overlayGraphicCtx.canvas.width;
var overlayHeight = this.overlayGraphicCtx.canvas.height;
this.buffers.shapeOverlayCtx = new CGraphics();
this.buffers.shapeOverlayCtx.init(this.overlayGraphicCtx.ctx, this.overlayGraphicCtx.getWidth(0), this.overlayGraphicCtx.getHeight(0), this.overlayGraphicCtx.getWidth(3), this.overlayGraphicCtx.getHeight(3));
this.buffers.shapeOverlayCtx.init(this.overlayGraphicCtx.ctx, overlayWidth, overlayHeight, (overlayWidth*25.4/this.overlayGraphicCtx.ppiX), (overlayHeight*25.4/this.overlayGraphicCtx.ppiY));
this.buffers.shapeOverlayCtx.m_oFontManager = this.fmgrGraphics[2];
this.stringRender = new asc.StringRender(this.buffers.main);
......
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