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

Grouping Objects together, the fill becomes black #2213

Closed
Terry-Fedirko opened this issue May 19, 2015 · 10 comments
Closed

Grouping Objects together, the fill becomes black #2213

Terry-Fedirko opened this issue May 19, 2015 · 10 comments

Comments

@Terry-Fedirko
Copy link

Just uploaded 1.5.0 from 1.4.14 and found an issue when grouping objects together. If you have 2 objects. Say a circle that is red filled and a triangle that is blue filled. When I tried to grouping these 2 objects together, the fill in both objects turn black. It does not retain the original color (red and blue or any other color other than black). Example below:

figure 1 - 2 objects blue cirle and greentriangle

Figure #1 - Both objects are created

figure 2 - 2 objects blue cirle and greentriangle selected

Figure #2 - Both objects are selected

figure 3 - 2 objects blue cirle and greentriangle grouping command

Figure #3 - Grouping them (programmed group into the context menu)

figure 4 - 2 objects blue cirle and greentriangle now black after grouping

Figure #4 - After grouping occurs, both objects turn black.

Note: this problem does NOT occur in 1.4.13.

@asturur
Copy link
Member

asturur commented May 19, 2015

If you submit a bug, please try to reduce code to the minimum to show the bug.
open a fiddle or something similar to explain it.

@asturur
Copy link
Member

asturur commented Jun 1, 2015

I suppose you are using some saving, loading from JSON.
if you can reproduce the bug without custom code in some jsfiddle we will reopen the issue.

@asturur asturur closed this as completed Jun 1, 2015
@spearson2010
Copy link

I'm not sure if this is the scenario the original poster had, but it seems similar. I'm loading JSON data, and when the data passes through fabric.util.enlivenObjects, the objects within the group inherit the fill set on the group.

Here is a fiddle: http://jsfiddle.net/SxBfp/64/
Change the group fill, and it will override the fill specificed on each unit. A color or blank (no fill) value will be inherited. Completely remove the fill attribute from the group, and the objects in the group maintain their original fill.

I'm not sure if this is by design or a bug.

@sapics
Copy link
Contributor

sapics commented Jun 18, 2015

@spearson2010 Thank you for giving information!
We have changed group initialization function recently, thus, the behavior would change in 1.5.1.

This is the current kangax/master builded version http://jsfiddle.net/sapics/SxBfp/65/.
Is this a what you expected one?

@spearson2010
Copy link

The fill of each item in the group is maintained, so that works for me. Question though, if I remove the fill attribute on each item, the fill becomes black. Is this a default, or should it then inherit the red fill from the group?

@rgwoodiii
Copy link

I'm having a similar issue, but right now I'm confused on what exactly fabric.util.enlivenObjects is. Does somebody mind explaining it to me?

@asturur
Copy link
Member

asturur commented Jul 25, 2015

is the function that switch from object form to class instances.
Maybe is a rought exaplanation.

from {type: 'rect', width : 50.... } to fabric.Rect

@Daomaster
Copy link

Hey Guys

I have the same issue when I try to group the objects in the active group, it fill everything in black.

Any Idea why?

image

image

http://jsfiddle.net/unu2xLj9/

@creaz35
Copy link

creaz35 commented Jan 13, 2022

I have the exact same problem.
Does not seem to be fixed?
Thanks

@asturur
Copy link
Member

asturur commented Jan 13, 2022

hi @creaz35 this is an issue from 2016.
On what version of fabric are you?

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

No branches or pull requests

8 participants