mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-24 11:15:51 +01:00
WINGs: simplify code
It looks like the original code was expecting the side effect of specifying a length in the %d to smartly truncate the number, which it does not. The new code has the same behaviour without extra complexity. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
070f0ad8f4
commit
8606ae9a83
@@ -181,10 +181,7 @@ static void drawRulerOnPixmap(Ruler * rPtr)
|
|||||||
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer,
|
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer,
|
||||||
rPtr->fgGC, rPtr->margins.left + m, 23, rPtr->margins.left + m, marks[i % 8] + 23);
|
rPtr->fgGC, rPtr->margins.left + m, 23, rPtr->margins.left + m, marks[i % 8] + 23);
|
||||||
if (i != 0 && i % 8 == 0) {
|
if (i != 0 && i % 8 == 0) {
|
||||||
if (j < 10)
|
snprintf(c, sizeof(c), "%d", ++j);
|
||||||
snprintf(c, 3, "%d", ++j);
|
|
||||||
else
|
|
||||||
snprintf(c, 3, "%2d", ++j);
|
|
||||||
WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
|
WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
|
||||||
rPtr->font, rPtr->margins.left + 2 + m, 26, c, 2);
|
rPtr->font, rPtr->margins.left + 2 + m, 26, c, 2);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user