This commit is contained in:
Joel Bodenmann 2015-11-04 07:11:49 +01:00
commit df76759cd4
3 changed files with 16 additions and 6 deletions

View File

@ -3169,7 +3169,15 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
/* Callback to render string boxes with word wrap. */
#if GDISP_NEED_TEXT_WORDWRAP
static bool mf_line_callback(mf_str line, uint16_t count, void *state) {
static bool mf_drawline_callback(mf_str line, uint16_t count, void *state) {
wrapParameters_t* wrapParameters = (wrapParameters_t*)state;
mf_render_aligned(wrapParameters->font, wrapParameters->x, wrapParameters->y, wrapParameters->justify, line, count, drawcharglyph, wrapParameters->g);
wrapParameters->y += wrapParameters->font->line_height;
return TRUE;
}
static bool mf_fillline_callback(mf_str line, uint16_t count, void *state) {
wrapParameters_t* wrapParameters = (wrapParameters_t*)state;
mf_render_aligned(wrapParameters->font, wrapParameters->x, wrapParameters->y, wrapParameters->justify, line, count, fillcharglyph, wrapParameters->g);
@ -3283,7 +3291,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
wrapParameters.justify = justify;
wrapParameters.g = g;
mf_wordwrap(font, cx, str, mf_line_callback, &wrapParameters);
mf_wordwrap(font, cx, str, mf_drawline_callback, &wrapParameters);
#else
mf_render_aligned(font, x, y, justify, str, 0, drawcharglyph, g);
#endif
@ -3336,7 +3344,7 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
wrapParameters.justify = justify;
wrapParameters.g = g;
mf_wordwrap(font, cx, str, mf_line_callback, &wrapParameters);
mf_wordwrap(font, cx, str, mf_fillline_callback, &wrapParameters);
#else
mf_render_aligned(font, x, y, justify, str, 0, fillcharglyph, g);
#endif

View File

@ -56,8 +56,10 @@ static GTIMER_DECL(MouseTimer);
#include <string.h> // Required for memcpy
static GFXINLINE void CalibrationTransform(GMouseReading *pt, const GMouseCalibration *c) {
coord_t x = (coord_t) (c->ax * pt->x + c->bx * pt->y + c->cx);
coord_t y = (coord_t) (c->ay * pt->x + c->by * pt->y + c->cy);
coord_t x, y;
x = (coord_t) (c->ax * pt->x + c->bx * pt->y + c->cx);
y = (coord_t) (c->ay * pt->x + c->by * pt->y + c->cy);
pt->x = x;
pt->y = y;

View File

@ -124,7 +124,7 @@ void gwinLabelSetBorder(GHandle gh, bool_t border);
*
* @api
*/
void gwinLabelDefaultDraw(GWidgetObject *gw, void *param)
void gwinLabelDefaultDraw(GWidgetObject *gw, void *param);
/** @} */