Added macros JUSTIFYMASK_HORIZONTAL, JUSTIFYMASK_VERTICAL to replace macros JUSTIFYMASK_LEFTRIGHT, JUSTIFYMASK_TOPBOTTOM
This commit is contained in:
parent
cbf1d4dfa0
commit
d9258efd4d
@ -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 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 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 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: Added gfxRealloc() to Qt port
|
||||||
FIX: Fixed UC1610 driver private area initialisation
|
FIX: Fixed UC1610 driver private area initialisation
|
||||||
FIX: Fixed ST7735 driver and added kapacuk changes
|
FIX: Fixed ST7735 driver and added kapacuk changes
|
||||||
|
@ -3478,7 +3478,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
|
|||||||
totalHeight = font->height;
|
totalHeight = font->height;
|
||||||
|
|
||||||
// Select the anchor position
|
// Select the anchor position
|
||||||
switch((justify & JUSTIFYMASK_TOPBOTTOM)) {
|
switch((justify & JUSTIFYMASK_VERTICAL)) {
|
||||||
case gJustifyTop:
|
case gJustifyTop:
|
||||||
break;
|
break;
|
||||||
case gJustifyBottom:
|
case gJustifyBottom:
|
||||||
@ -3488,7 +3488,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
|
|||||||
y += (cy+1 - totalHeight)/2;
|
y += (cy+1 - totalHeight)/2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch((justify & JUSTIFYMASK_LEFTRIGHT)) {
|
switch((justify & JUSTIFYMASK_HORIZONTAL)) {
|
||||||
case gJustifyCenter:
|
case gJustifyCenter:
|
||||||
x += (cx + 1) / 2;
|
x += (cx + 1) / 2;
|
||||||
break;
|
break;
|
||||||
@ -3504,14 +3504,14 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
|
|||||||
g->t.color = color;
|
g->t.color = color;
|
||||||
#if GDISP_NEED_TEXT_WORDWRAP
|
#if GDISP_NEED_TEXT_WORDWRAP
|
||||||
if (!(justify & gJustifyNoWordWrap)) {
|
if (!(justify & gJustifyNoWordWrap)) {
|
||||||
g->t.lrj = (justify & JUSTIFYMASK_LEFTRIGHT);
|
g->t.lrj = (justify & JUSTIFYMASK_HORIZONTAL);
|
||||||
g->t.wrapx = x;
|
g->t.wrapx = x;
|
||||||
g->t.wrapy = y;
|
g->t.wrapy = y;
|
||||||
|
|
||||||
mf_wordwrap(font, cx, str, mf_drawline_callback, g);
|
mf_wordwrap(font, cx, str, mf_drawline_callback, g);
|
||||||
} else
|
} else
|
||||||
#endif
|
#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);
|
autoflush(g);
|
||||||
MUTEX_EXIT(g);
|
MUTEX_EXIT(g);
|
||||||
@ -3567,7 +3567,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
|
|||||||
totalHeight = font->height;
|
totalHeight = font->height;
|
||||||
|
|
||||||
// Select the anchor position
|
// Select the anchor position
|
||||||
switch((justify & JUSTIFYMASK_TOPBOTTOM)) {
|
switch((justify & JUSTIFYMASK_VERTICAL)) {
|
||||||
case gJustifyTop:
|
case gJustifyTop:
|
||||||
break;
|
break;
|
||||||
case gJustifyBottom:
|
case gJustifyBottom:
|
||||||
@ -3577,7 +3577,7 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
|
|||||||
y += (cy+1 - totalHeight)/2;
|
y += (cy+1 - totalHeight)/2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch((justify & JUSTIFYMASK_LEFTRIGHT)) {
|
switch((justify & JUSTIFYMASK_HORIZONTAL)) {
|
||||||
case gJustifyCenter:
|
case gJustifyCenter:
|
||||||
x += (cx + 1) / 2;
|
x += (cx + 1) / 2;
|
||||||
break;
|
break;
|
||||||
@ -3594,14 +3594,14 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
|
|||||||
g->t.bgcolor = bgcolor;
|
g->t.bgcolor = bgcolor;
|
||||||
#if GDISP_NEED_TEXT_WORDWRAP
|
#if GDISP_NEED_TEXT_WORDWRAP
|
||||||
if (!(justify & gJustifyNoWordWrap)) {
|
if (!(justify & gJustifyNoWordWrap)) {
|
||||||
g->t.lrj = (justify & JUSTIFYMASK_LEFTRIGHT);
|
g->t.lrj = (justify & JUSTIFYMASK_HORIZONTAL);
|
||||||
g->t.wrapx = x;
|
g->t.wrapx = x;
|
||||||
g->t.wrapy = y;
|
g->t.wrapy = y;
|
||||||
|
|
||||||
mf_wordwrap(font, cx, str, mf_fillline_callback, g);
|
mf_wordwrap(font, cx, str, mf_fillline_callback, g);
|
||||||
} else
|
} else
|
||||||
#endif
|
#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);
|
autoflush(g);
|
||||||
|
@ -69,8 +69,8 @@ typedef enum gJustify {
|
|||||||
gJustifyPad = 0x00, /**< Pad the text box (the default) */
|
gJustifyPad = 0x00, /**< Pad the text box (the default) */
|
||||||
gJustifyNoPad = 0x04 /**< No padding the text box */
|
gJustifyNoPad = 0x04 /**< No padding the text box */
|
||||||
} gJustify;
|
} gJustify;
|
||||||
#define JUSTIFYMASK_LEFTRIGHT (gJustifyLeft|gJustifyCenter|gJustifyRight)
|
#define JUSTIFYMASK_HORIZONTAL (gJustifyLeft|gJustifyCenter|gJustifyRight)
|
||||||
#define JUSTIFYMASK_TOPBOTTOM (gJustifyTop|gJustifyMiddle|gJustifyBottom)
|
#define JUSTIFYMASK_VERTICAL (gJustifyTop|gJustifyMiddle|gJustifyBottom)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @enum gFontmetric
|
* @enum gFontmetric
|
||||||
@ -1251,6 +1251,8 @@ void gdispGDrawBox(GDisplay *g, gCoord x, gCoord y, gCoord cx, gCoord cy, gColor
|
|||||||
#define justifyNoWordWrap gJustifyNoWordWrap
|
#define justifyNoWordWrap gJustifyNoWordWrap
|
||||||
#define justifyPad gJustifyPad
|
#define justifyPad gJustifyPad
|
||||||
#define justifyNoPad gJustifyNoPad
|
#define justifyNoPad gJustifyNoPad
|
||||||
|
#define JUSTIFYMASK_LEFTRIGHT JUSTIFYMASK_HORIZONTAL
|
||||||
|
#define JUSTIFYMASK_TOPBOTTOM JUSTIFYMASK_VERTICAL
|
||||||
typedef gFontmetric fontmetric_t;
|
typedef gFontmetric fontmetric_t;
|
||||||
#define fontHeight gFontHeight
|
#define fontHeight gFontHeight
|
||||||
#define fontDescendersHeight gFontDescendersHeight
|
#define fontDescendersHeight gFontDescendersHeight
|
||||||
|
Loading…
Reference in New Issue
Block a user