mirror of
https://github.com/ONLYOFFICE/sdkjs.git
synced 2026-04-07 14:09:12 +08:00
Fix bug #76921
This commit is contained in:
@ -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
|
||||
{
|
||||
|
||||
@ -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
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user