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

Setting background image to color with roundAsCircle="true" should be masked by circle #57

Closed
emhagman opened this issue Apr 1, 2015 · 3 comments
Assignees

Comments

@emhagman
Copy link

emhagman commented Apr 1, 2015

At the moment, displaying the image with roundAsCircle set to true creates a square around the circle as a background when setting backgroundImage to @color/white or any other color resource.

In my opinion, it makes sense for the circle to be used as a mask for the background.

Current code:

Proposed fix:

Appologies for the teribble photo shopping, just trying get point across.

@blackiedm
Copy link

in this case, you can use RoundingParams.RoundingMethod.BITMAP_ONLY:
just like this:

RoundingParams roundingParams = new RoundingParams();
roundingParams.setRoundAsCircle(true);
roundingParams.setBorder(R.color.border_color, 10);
roundingParams.setRoundingMethod(RoundingParams.RoundingMethod.BITMAP_ONLY);

and set it to GenericDraweeHierarchyBuilder;

@plamenko
Copy link
Contributor

plamenko commented Apr 2, 2015

The thing is that we do not apply rounding on overlays and backgrounds when using the BITMAP_ONLY mode (which is default). I'll try to send a fix for that.

But, we do provide RoundedColorDrawable, so as a workaround, you can use that if you are creating your hierarchy programmatically.
https://github.com/facebook/fresco/blob/847851a8de6d223c0a6634447bddee1252e01c64/drawee/src/main/java/com/facebook/drawee/drawable/RoundedColorDrawable.java

@plamenko plamenko self-assigned this Apr 2, 2015
@tyronen
Copy link
Contributor

tyronen commented Apr 16, 2015

Fixed in 0.3.0.

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

4 participants