Fix drawing of vertical border text in certain themes.
SVN revision: 22870
This commit is contained in:
parent
e42c924a34
commit
05e174204f
10
src/iclass.c
10
src/iclass.c
|
@ -1193,13 +1193,9 @@ ITApply(Win win, ImageClass * ic, ImageState * is, int w, int h,
|
|||
EXCopyArea(pmm.pmap, pmap, 0, 0, w, h, 0, 0);
|
||||
}
|
||||
|
||||
TextstateDrawText(ts, win, pmap, text, ic->padding.left,
|
||||
ic->padding.top,
|
||||
w - (ic->padding.left +
|
||||
ic->padding.right),
|
||||
h - (ic->padding.top +
|
||||
ic->padding.bottom),
|
||||
0, TextclassGetJustification(tc));
|
||||
TextstateDrawText(ts, win, pmap, text, 0, 0, w, h,
|
||||
&(ic->padding), 0,
|
||||
TextclassGetJustification(tc));
|
||||
}
|
||||
|
||||
/* Set window pixmap */
|
||||
|
|
|
@ -84,7 +84,8 @@ TextState *TextclassGetTextState(TextClass * tclass, int state,
|
|||
int active, int sticky);
|
||||
void TextstateDrawText(TextState * ts, Win win, Drawable draw,
|
||||
const char *text, int x, int y, int w,
|
||||
int h, int fsize, int justification);
|
||||
int h, const EImageBorder * pad,
|
||||
int fsize, int justification);
|
||||
void TextSize(TextClass * tclass, int active, int sticky,
|
||||
int state, const char *text, int *width,
|
||||
int *height, int fsize);
|
||||
|
|
29
src/text.c
29
src/text.c
|
@ -420,8 +420,8 @@ _set_gc_color(Win win, GC gc, XColor * pxc)
|
|||
|
||||
void
|
||||
TextstateDrawText(TextState * ts, Win win, Drawable draw, const char *text,
|
||||
int x, int y, int w, int h, int fsize __UNUSED__,
|
||||
int justification)
|
||||
int x, int y, int w, int h, const EImageBorder * pad,
|
||||
int fsize __UNUSED__, int justification)
|
||||
{
|
||||
const char *str;
|
||||
char **lines;
|
||||
|
@ -448,9 +448,27 @@ TextstateDrawText(TextState * ts, Win win, Drawable draw, const char *text,
|
|||
|
||||
if (ts->style.orientation == FONT_TO_RIGHT ||
|
||||
ts->style.orientation == FONT_TO_LEFT)
|
||||
textwidth_limit = w;
|
||||
{
|
||||
if (pad)
|
||||
{
|
||||
x += pad->left;
|
||||
w -= pad->left + pad->right;
|
||||
y += pad->top;
|
||||
h -= pad->top + pad->bottom;
|
||||
}
|
||||
textwidth_limit = w;
|
||||
}
|
||||
else
|
||||
textwidth_limit = h;
|
||||
{
|
||||
if (pad)
|
||||
{
|
||||
x += pad->left;
|
||||
h -= pad->left + pad->right;
|
||||
y += pad->top;
|
||||
w -= pad->top + pad->bottom;
|
||||
}
|
||||
textwidth_limit = h;
|
||||
}
|
||||
|
||||
xx = x;
|
||||
yy = y;
|
||||
|
@ -886,5 +904,6 @@ TextDraw(TextClass * tclass, Win win, Drawable draw, int active, int sticky,
|
|||
if (!ts)
|
||||
return;
|
||||
|
||||
TextstateDrawText(ts, win, draw, text, x, y, w, h, fsize, justification);
|
||||
TextstateDrawText(ts, win, draw, text, x, y, w, h, NULL, fsize,
|
||||
justification);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue