diff --git a/word/Drawing/Graphics.js b/word/Drawing/Graphics.js index b2fe863b43..bc2b46e67a 100644 --- a/word/Drawing/Graphics.js +++ b/word/Drawing/Graphics.js @@ -691,7 +691,18 @@ if (_sy >= _sb || _sy >= _h || _sb <= 0 || h <= 0) return; - this.m_oContext.drawImage(img,_sx,_sy,_sr-_sx,_sb-_sy,x,y,w,h); + if (this.isVectorImage(img)) { + const canvas = this.m_oContext.canvas; + const scale = Math.min(canvas.width / img.width, canvas.height / img.height); + this.m_oContext.drawImage( + img, + _sx * scale, _sy * scale, + (_sr - _sx) * scale, (_sb - _sy) * scale, + x, y, w, h + ); + } else { + this.m_oContext.drawImage(img, _sx, _sy, _sr - _sx, _sb - _sy, x, y, w, h); + } } else { diff --git a/word/Drawing/ShapeDrawer.js b/word/Drawing/ShapeDrawer.js index a1a65f8ebd..22ff1a86e4 100644 --- a/word/Drawing/ShapeDrawer.js +++ b/word/Drawing/ShapeDrawer.js @@ -1804,12 +1804,15 @@ CShapeDrawer.prototype = const useTransparency = this.IsRectShape ? true : graphics.isSupportTextDraw() && !graphics.isTrack(); const alpha = (isTransparent && useTransparency) ? this.UniFill.transparent / 255 : 1; + // this.UniFill.fill.srcRect === this.Shape.brush.fill.srcRect === this.Shape.blipFill.srcRect + const srcRect = this.UniFill.fill.srcRect; + graphics.drawBlipFillStretch( rotWithShape ? null : invertedTransform, imageData.src, alpha, dstRect.l, dstRect.t, dstRect.r - dstRect.l, dstRect.b - dstRect.t, - this.UniFill.fill.srcRect, + srcRect, this.UniFill.fill.canvas ); },