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

Added "cx" and "cy" property to the label to change center of Label #22

Open
wants to merge 4 commits into
base: master
from

Conversation

@neoxharsh
Copy link

neoxharsh commented Oct 22, 2019

I have added "cx" and "cy" property to the label, such that setting those will move the center of the text rather than the top left corner of the text. My apologies if it is already available.

Eg. for PyPortal

timeDisplay = label.Label(font,text='12:60:60',color=color)
timeDisplay.cx = 160 
timeDisplay.cy = 120
@tannewt

This comment has been minimized.

Copy link
Contributor

tannewt commented Nov 2, 2019

I like how you are using the Group's x and y to handle this! I'd rather not add separate cx and cy properties though. Instead, I'd like to see one or two properties that set the anchor position. Right how it's fixed as Center Left but you'd like Center Center.

With the anchor property, changes to the bounding box, x, or y (overridden) would trigger changing the Group's x and y.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.