This commit is contained in:
Eduard Belozertsev
2025-10-01 19:39:13 +07:00
parent 170c798657
commit 4480d81762
2 changed files with 16 additions and 2 deletions

View File

@ -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
{

View File

@ -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
);
},