aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@seriouslyembedded.com>2015-11-04 07:11:49 +0100
committerJoel Bodenmann <joel@seriouslyembedded.com>2015-11-04 07:11:49 +0100
commitdf76759cd43e4d6edcf089c05420ab2180ff4491 (patch)
treef96c4b3392b0166cf6ee0838f269139918fafdbb /src
parent96789916e3c6b8db8f4b1aba4ff5c36b0137bf3f (diff)
parentb276bd7a4b3a0d213d95fab3e2a425fc8be92fe6 (diff)
downloaduGFX-df76759cd43e4d6edcf089c05420ab2180ff4491.tar.gz
uGFX-df76759cd43e4d6edcf089c05420ab2180ff4491.tar.bz2
uGFX-df76759cd43e4d6edcf089c05420ab2180ff4491.zip
Merge branch 'master' of https://bitbucket.org/Tectu/ugfx
Diffstat (limited to 'src')
-rw-r--r--src/gdisp/gdisp.c14
-rw-r--r--src/ginput/ginput_mouse.c6
-rw-r--r--src/gwin/gwin_label.h2
3 files changed, 16 insertions, 6 deletions
diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c
index ea9fcc7a..84215796 100644
--- a/src/gdisp/gdisp.c
+++ b/src/gdisp/gdisp.c
@@ -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
diff --git a/src/ginput/ginput_mouse.c b/src/ginput/ginput_mouse.c
index 881d6339..f149217d 100644
--- a/src/ginput/ginput_mouse.c
+++ b/src/ginput/ginput_mouse.c
@@ -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;
diff --git a/src/gwin/gwin_label.h b/src/gwin/gwin_label.h
index 2b784b3a..84836bf2 100644
--- a/src/gwin/gwin_label.h
+++ b/src/gwin/gwin_label.h
@@ -124,7 +124,7 @@ void gwinLabelSetBorder(GHandle gh, bool_t border);
*
* @api
*/
-void gwinLabelDefaultDraw(GWidgetObject *gw, void *param)
+void gwinLabelDefaultDraw(GWidgetObject *gw, void *param);
/** @} */