diff options
-rw-r--r-- | changelog.txt | 1 | ||||
-rw-r--r-- | src/gdisp/gdisp.c | 16 | ||||
-rw-r--r-- | src/gdisp/gdisp.h | 6 |
3 files changed, 13 insertions, 10 deletions
diff --git a/changelog.txt b/changelog.txt index b5678105..77606947 100644 --- a/changelog.txt +++ b/changelog.txt @@ -27,6 +27,7 @@ CHANGE: Added type gFont to replace V2.x font_t CHANGE: Added type gPowermode to replace V2.x powermode_t, and values gPowerXXX replace powerXXX
CHANGE: Added type gJustify to replace V2.x justify_t, and values gJustifyXXX replace justifyXXX
CHANGE: Added type gFontmetric to replace V2.x fontmetric_t, and values gFontXXX replace fontXXX
+CHANGE: Added macros JUSTIFYMASK_HORIZONTAL, JUSTIFYMASK_VERTICAL to replace macros JUSTIFYMASK_LEFTRIGHT, JUSTIFYMASK_TOPBOTTOM
FIX: Added gfxRealloc() to Qt port
FIX: Fixed UC1610 driver private area initialisation
FIX: Fixed ST7735 driver and added kapacuk changes
diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c index 39f17ff3..b1180b92 100644 --- a/src/gdisp/gdisp.c +++ b/src/gdisp/gdisp.c @@ -3478,7 +3478,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor totalHeight = font->height; // Select the anchor position - switch((justify & JUSTIFYMASK_TOPBOTTOM)) { + switch((justify & JUSTIFYMASK_VERTICAL)) { case gJustifyTop: break; case gJustifyBottom: @@ -3488,7 +3488,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor y += (cy+1 - totalHeight)/2; break; } - switch((justify & JUSTIFYMASK_LEFTRIGHT)) { + switch((justify & JUSTIFYMASK_HORIZONTAL)) { case gJustifyCenter: x += (cx + 1) / 2; break; @@ -3504,14 +3504,14 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor g->t.color = color; #if GDISP_NEED_TEXT_WORDWRAP if (!(justify & gJustifyNoWordWrap)) { - g->t.lrj = (justify & JUSTIFYMASK_LEFTRIGHT); + g->t.lrj = (justify & JUSTIFYMASK_HORIZONTAL); g->t.wrapx = x; g->t.wrapy = y; mf_wordwrap(font, cx, str, mf_drawline_callback, g); } else #endif - mf_render_aligned(font, x, y, (justify & JUSTIFYMASK_LEFTRIGHT), str, 0, drawcharglyph, g); + mf_render_aligned(font, x, y, (justify & JUSTIFYMASK_HORIZONTAL), str, 0, drawcharglyph, g); autoflush(g); MUTEX_EXIT(g); @@ -3567,7 +3567,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor totalHeight = font->height; // Select the anchor position - switch((justify & JUSTIFYMASK_TOPBOTTOM)) { + switch((justify & JUSTIFYMASK_VERTICAL)) { case gJustifyTop: break; case gJustifyBottom: @@ -3577,7 +3577,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor y += (cy+1 - totalHeight)/2; break; } - switch((justify & JUSTIFYMASK_LEFTRIGHT)) { + switch((justify & JUSTIFYMASK_HORIZONTAL)) { case gJustifyCenter: x += (cx + 1) / 2; break; @@ -3594,14 +3594,14 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor g->t.bgcolor = bgcolor; #if GDISP_NEED_TEXT_WORDWRAP if (!(justify & gJustifyNoWordWrap)) { - g->t.lrj = (justify & JUSTIFYMASK_LEFTRIGHT); + g->t.lrj = (justify & JUSTIFYMASK_HORIZONTAL); g->t.wrapx = x; g->t.wrapy = y; mf_wordwrap(font, cx, str, mf_fillline_callback, g); } else #endif - mf_render_aligned(font, x, y, (justify & JUSTIFYMASK_LEFTRIGHT), str, 0, fillcharglyph, g); + mf_render_aligned(font, x, y, (justify & JUSTIFYMASK_HORIZONTAL), str, 0, fillcharglyph, g); } autoflush(g); diff --git a/src/gdisp/gdisp.h b/src/gdisp/gdisp.h index 338ec5a0..8a573456 100644 --- a/src/gdisp/gdisp.h +++ b/src/gdisp/gdisp.h @@ -69,8 +69,8 @@ typedef enum gJustify { gJustifyPad = 0x00, /**< Pad the text box (the default) */ gJustifyNoPad = 0x04 /**< No padding the text box */ } gJustify; -#define JUSTIFYMASK_LEFTRIGHT (gJustifyLeft|gJustifyCenter|gJustifyRight) -#define JUSTIFYMASK_TOPBOTTOM (gJustifyTop|gJustifyMiddle|gJustifyBottom) +#define JUSTIFYMASK_HORIZONTAL (gJustifyLeft|gJustifyCenter|gJustifyRight) +#define JUSTIFYMASK_VERTICAL (gJustifyTop|gJustifyMiddle|gJustifyBottom) /** * @enum gFontmetric @@ -1251,6 +1251,8 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor #define justifyNoWordWrap gJustifyNoWordWrap #define justifyPad gJustifyPad #define justifyNoPad gJustifyNoPad + #define JUSTIFYMASK_LEFTRIGHT JUSTIFYMASK_HORIZONTAL + #define JUSTIFYMASK_TOPBOTTOM JUSTIFYMASK_VERTICAL typedef gFontmetric fontmetric_t; #define fontHeight gFontHeight #define fontDescendersHeight gFontDescendersHeight |