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

Cut off strings too long to show in ugfx.List #221

Closed

Conversation

DigitalBrains1
Copy link

This relates to pull request #216. @basvs wrote:

I guess we need to disable the 'center vertically' in C code.

This patch does exactly that. Since this patch is already very useful on its own, I created a new pull request for it.

I'm not too sure about the #ifdef GDISP_NEED_CLIP, though it will compile without it defined, it will render very wrongly. Maybe compilation should fail, perhaps with an error pragma?

@DigitalBrains1
Copy link
Author

Oh, by the way, the MIN() macro does double evaluation of its arguments, but that's not a problem here. I'm not too fond of it though, which is why I'm mentioning it.

@@ -635,7 +635,13 @@ void BWgwinListDefaultDraw(GWidgetObject* gw, void* param) {
}
}
#endif
gdispGFillStringBox(gw->g.display, gw->g.x+x+LST_HORIZ_PAD, gw->g.y+y, iwidth-LST_HORIZ_PAD, iheight, qi2li->text, gw->g.font, text, fill, justifyLeft);
Copy link

Choose a reason for hiding this comment

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

why not justifyLeft | justifyTop ? That seems to work.

Copy link
Author

Choose a reason for hiding this comment

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

It does?!

I just read the API docs and they say that text is always vertically centered and justify only adjusts horizontal. So either you're getting unintended correctness or the docs need to be updated :-).

Copy link
Author

Choose a reason for hiding this comment

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

justifyTop is not mentioned either.

Copy link

Choose a reason for hiding this comment

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

I read the header file and found this constant. Tried it and it seemed to work. Haven't done further testing. :)

@basvs
Copy link

basvs commented Aug 15, 2017

I've added my alternative pull-request here: #222

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.

2 participants