Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect caching of figure with border and rotation #1886

Open
Tsimur-Mikula opened this issue Feb 4, 2025 · 2 comments
Open

Incorrect caching of figure with border and rotation #1886

Tsimur-Mikula opened this issue Feb 4, 2025 · 2 comments

Comments

@Tsimur-Mikula
Copy link

Hi, I have problems caching a shape (group with a shape) under certain conditions:

  1. Cached shape at an angle with a shadow has the shadow position incorrect.
  2. Cached shape with a border and a shadow has the border drawn on the shadow.

1.1) figure at an angle with shadow and border uncached (works correctly)
Image

1.2) figure at an angle with shadow and border cached (does not work correctly)
Image

2.1) figure with shadow and border is uncached (works correctly)
Image

2.2) figure with shadow and border is cached (does not work correctly)
Image

version konva: "^9.3.18"
Link to the sandbox with these cases:
https://stackblitz.com/edit/typescript-konva-cjm4cnge?file=index.ts

@lavrton
Copy link
Member

lavrton commented Feb 11, 2025

The shadow position is a "won't fix" issue.

Without caching, rotating of a node doesn't move the shadow. It stays in the same place (same offset) while the node is rotating.
Caching converts a node into a static image. So the whole image is rotated. So it moves the shadow. Here is the difference:

Image

Demo: https://jsbin.com/juhecuwonu/2/edit?html,js,output

The stroke on shadow issue probably should be fixed.

@Tsimur-Mikula
Copy link
Author

@lavrton Thanks for the reply. Could you make the caching of the figure with shadow and border correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants