-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
viewportTransform affects Object.toDataURL #5063
Comments
oh i see were the problem comes from. I think being able to choose between a dataurl representation of the object as it is on the canvas, and neutral, as a sort of So i would remove viewport influence anyway and add an option ( to be better named ) withoutTransform true/false, default to false since it has been always like that. |
All this sounds good. In my tests passing (Currently we're doing)
|
that toDataURL from _filteredEl is a plain javascript toDataUrl and is not the fabricJS one. So for that if there is a problem, is probably not a fabricJS one. |
Sorry, I misspoke, we've been using the _filteredEl one because of some weird inconsistencies we saw with fabric's toDataURL and filtered images. We were using it expecting it to be an object export utility though. Hearing that it's meant to include the object's properties on the canvas may actually explain all of those away. |
When i arrived, 4 years ago, it was already like that. I have no idea what was the original idea behind that method. I do think that now, a way to export it with neutral properties and another to export it as you see it, is fine and do not require any big effort |
Opened a small PR, i was wondering how this should work when you target an object that is inside a group. what the withoutTransform should do? |
Version
2.3.3
Test Case
https://codepen.io/anon/pen/eKKaVr
Steps to reproduce
Expected Behavior
a dataURL that represents the current state of the image
Actual Behavior
a dataURL that zooms (and inherently crops) the image based on the viewport transform of the canvas.
Somewhat (but not completely) related to #4602
The text was updated successfully, but these errors were encountered: