Skip to content

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

Closed
DigitalBrains1 wants to merge 1 commit intoSHA2017-badge:masterfrom
DigitalBrains1:list_render_one
Closed

Cut off strings too long to show in ugfx.List#221
DigitalBrains1 wants to merge 1 commit intoSHA2017-badge:masterfrom
DigitalBrains1:list_render_one

Conversation

@DigitalBrains1
Copy link
Copy Markdown

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
Copy Markdown
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.

}
}
#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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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