diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2024-07-03 10:19:30 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2024-07-03 10:19:30 +0200 |
commit | a14a7a0ccc9de76aeab0b2e4bbf58f1a79deedc2 (patch) | |
tree | e469179df67a0e0db49161a43cbf8076a189f6f4 /app/wlib/mswlib/mswlines.c | |
parent | 5d2c2b27a6323e2666378b986129b2a7c2c39e5c (diff) |
New upstream version 5.3.0GAupstream/5.3.0GAupstream
Diffstat (limited to 'app/wlib/mswlib/mswlines.c')
-rw-r--r-- | app/wlib/mswlib/mswlines.c | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/app/wlib/mswlib/mswlines.c b/app/wlib/mswlib/mswlines.c index f6bb574..a55618e 100644 --- a/app/wlib/mswlib/mswlines.c +++ b/app/wlib/mswlib/mswlines.c @@ -1,6 +1,5 @@ #include <windows.h> #include <string.h> -#include <malloc.h> #include <stdlib.h> #include <commdlg.h> #include <math.h> @@ -15,10 +14,10 @@ */ struct wLine_t { - WOBJ_COMMON - int count; - wLines_t * lines; - }; + WOBJ_COMMON + int count; + wLines_t * lines; +}; static void repaintLines( HWND hWnd, wControl_p b ) { @@ -45,24 +44,26 @@ static void repaintLines( HWND hWnd, wControl_p b ) static callBacks_t linesCallBacks = { - repaintLines, - NULL, - NULL }; + repaintLines, + NULL, + NULL +}; wLine_p wLineCreate( - wWin_p parent, - const char * labelStr, - int count, - wLines_t * lines ) + wWin_p parent, + const char * labelStr, + int count, + wLines_t * lines ) { wLine_p b; wLines_p lp; wWinPix_t minX, maxX, minY, maxY; int index; - if (count <= 0) + if (count <= 0) { return NULL; + } b = (wLine_p)mswAlloc( parent, B_LINES, labelStr, sizeof *b, NULL, &index ); b->count = count; b->lines = lines; @@ -71,22 +72,30 @@ wLine_p wLineCreate( minX = maxX = lp->x0; minY = maxY = lp->y0; for (lp=lines; lp<&b->lines[count]; lp++) { - if (minX > lp->x0) + if (minX > lp->x0) { minX = lp->x0; - if (maxX < lp->x0) + } + if (maxX < lp->x0) { maxX = lp->x0; - if (minY > lp->y0) + } + if (minY > lp->y0) { minY = lp->y0; - if (maxY < lp->y0) + } + if (maxY < lp->y0) { maxY = lp->y0; - if (minX > lp->x1) + } + if (minX > lp->x1) { minX = lp->x1; - if (maxX < lp->x1) + } + if (maxX < lp->x1) { maxX = lp->x1; - if (minY > lp->y1) + } + if (minY > lp->y1) { minY = lp->y1; - if (maxY < lp->y1) + } + if (maxY < lp->y1) { maxY = lp->y1; + } } b->x = minX; b->y = minY; |