Automattic / node-canvas

Node canvas is a Cairo backed Canvas implementation for NodeJS.
10.2k stars 1.17k forks source link

Shape appply fillpaternImage + opacity #2438

Open TanPham1803 opened 1 month ago

TanPham1803 commented 1 month ago

Hi I have face the problem that when I apply opacity that 0<opacity<1 for the Path node and use scale in fillParternImage .The image converts to low resolution . But it still work correctly for the opacity 1

pathAttribute {
  id: '29aef1c1-7fb0-4aed-a1ae-b20d73e1eebd',
  width: 200,
  height: 219,
  scaleX: 6.451612903225806,
  scaleY: 6.4411764705882355,
  x: 0,
  y: 0,
  shadowColor: 'undefined',
  shadowBlur: 4.65,
  shadowOpacity: 0,
  shadowOffsetX: 0,
  shadowOffsetY: 0,
  fill: '#8F8F8F',
  stroke: 'transparent',
  strokeWidth: 0,
  data: 'M0.805847 14.9442V33.25H30.1942V14.9442L15.5 0.25L0.805847 14.9442Z',
  opacity: 0.77,
  fillRule: undefined,
  clipRule: undefined,
  offsetX: undefined,
  offsetY: undefined,
  fillPatternScaleX: 0.155,
  fillPatternScaleY: 0.1552511415525114,
  fillPatternImage: [Image:200x219 C:\Obello\bel-node-video-lambda\lambda\public\20241105T050208897Z\images\image-29aef1c1-7fb0-4aed-a1ae-b20d73e1eebd.png complete]
}

const shape = konvaPath(pathAttribute)

Image