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

adding anchored position example #30

Merged
merged 2 commits into from
Jan 29, 2020
Merged

adding anchored position example #30

merged 2 commits into from
Jan 29, 2020

Conversation

FoamyGuy
Copy link
Contributor

No description provided.

Copy link
Contributor

@caternuson caternuson left a comment

Choose a reason for hiding this comment

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

Tested on a PyPortal. Works. Changes are mainly cosmetic.

text_group.append(text_area_bottom_right)

print(text_area_top_right.anchored_position)
print(text_area_top_right.anchor_point)
Copy link
Contributor

Choose a reason for hiding this comment

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

still need these prints?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would say the prints are not really essential, I mainly put them to test and ensure the getters were working as expected. I can remove them.

text_area_middle_right.anchor_point = (1.0, 0.5)
text_area_middle_right.anchored_position = (DISPLAY_WIDTH-10, DISPLAY_HEIGHT/2)


Copy link
Contributor

Choose a reason for hiding this comment

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

extra line

DISPLAY_HEIGHT = 240

text_group = displayio.Group(max_size=9)
text = "Hello"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is like a const, so maybe change it to TEXT and move it up by the DISPLAY_ defs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, agreed. Will do.

DISPLAY_WIDTH = 320
DISPLAY_HEIGHT = 240

text_group = displayio.Group(max_size=9)
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be better moved to just before your first text_group.append line below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like it, better to keep the text_group setup together than have it split by all of the lines setting up labels. I will make this change along with the others in the next commit

…. moving text_group setup code all together. cleanup some whitespace.
@caternuson
Copy link
Contributor

Thanks for the updates. Looks good.

@caternuson caternuson merged commit 193f6b5 into adafruit:master Jan 29, 2020
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jan 30, 2020
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.

None yet

2 participants