Skip to content

Changes to shape objects to explicitly set opaque property when changing colors #8

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

Merged
merged 3 commits into from
Nov 1, 2019

Conversation

DavePutz
Copy link

When a shapes color or transparency is being changed the proper transparent or opaque properties need to be changed in case it is going from a transparent to opaque state (or vice-versa). Also, in the roundrect init the chunk needs to be drawn even if the initial fill is None; otherwise there seems to be nothing to change the color of later on.

…ing colors

When a shapes color or transparency is being changed the proper transparent or opaque properties need to be changed in case it is going from a transparent to opaque state (or vice-versa). Also, in the roundrect __init__ the chunk needs to be drawn even if the initial fill in None; otherwise there seems to be nothing to change to color of later on.
@ladyada ladyada requested a review from makermelissa October 30, 2019 23:25
Copy link
Collaborator

@makermelissa makermelissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor change needed for Travis to pass. Have you tested this or do you have any code for testing this out? Thanks

for j in range(r, height - r): # draw the center chunk
self._bitmap[i, j] = 2
self._helper(r, r, r, color=2, fill=True,
x_offset=width-2*r-1, y_offset=height-2*r-1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it failed the checks because a space need to be added to this line.

@DavePutz
Copy link
Author

DavePutz commented Oct 31, 2019 via email

@makermelissa
Copy link
Collaborator

Ok, awesome. I will test this later today.

Copy link
Collaborator

@makermelissa makermelissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested before and after changes and I could see the effect. Tested in both CP 4 and 5.

@makermelissa makermelissa merged commit 6219aa0 into adafruit:master Nov 1, 2019
@makermelissa
Copy link
Collaborator

Thanks for adding this!

@jpecor
Copy link

jpecor commented Nov 1, 2019

Thanks for the fix to this issue! I haven't had a chance to test it with the original project where I ran across the problem, but I hope to do that this weekend.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @DavePutz ! One comment about a comment but looks good otherwise. Thanks!

* Adafruit CircuitPython firmware for the supported boards:
https://github.com/adafruit/circuitpython/releases
A slightly modified version of Adafruit_CircuitPython_Display_Shapes that includes
an explicit call to palette.make_opaque() in the fill color setter function.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer true. It should document what a roundrect is.

makermelissa pushed a commit that referenced this pull request Jul 22, 2020
Pylint updates and ran black
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

Successfully merging this pull request may close these issues.

4 participants