fabricjs / fabric.js

Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser
http://fabricjs.com
Other
29.02k stars 3.51k forks source link

[Bug]: Object at the bottom "bleed" through the edge of top object #10225

Open LikitSaeLee opened 2 weeks ago

LikitSaeLee commented 2 weeks ago

CheckList

Version

6.0.2

In What environments are you experiencing the problem?

Firefox, Chrome

Node Version (if applicable)

None

Link To Reproduction

https://stackblitz.com/edit/js-zyyzqo?file=index.js (updated with red rect behind a yellow rect, added zoom and unzoom button)

Steps To Reproduce

Hi, thanks for the wonderful project! I met a weird issue with rendering objects on top of each other, would love to know why it happens and if there is any workaround for this.

  1. Create two Rects of the same size, with white rect on top of the black rect.
  2. Play with various level of zoom.
  3. The color of the black rect behind will "bleed" through the top object and visible on the canvas.

image

The issue can also happens to image, where the image will "bleed" through edges of the rect. Although both of them are of the same size.

https://stackblitz.com/edit/js-7zadzc?file=index.html,index.js

image

  1. At the video below, notice the edge of the rect object. The bleeding seems to different on various zoom level. Screencast from 17-10-24 21:22:57.webm

Expected Behavior

The rect on top should fully cover the rect behind.

Actual Behavior

The rect behind "bleed" through the edge of the rect on top.

Error Message & Stack Trace

No response

LikitSaeLee commented 4 days ago

not sure about this but it seems like its an issue with html canvas itself https://stackblitz.com/edit/vitejs-vite-9acvhj?file=src%2Fmain.ts