Changeset 24380 for trunk/magic/remove/src/Line.c
- Timestamp:
- Jun 11, 2009, 4:25:08 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/Line.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/Line.c
r24344 r24380 345 345 MaxBounds (&offsetLine, &xBegin, &xEnd, &yBegin, &yEnd); 346 346 347 if (xBegin > xEnd)348 SwapInt (&xBegin, &xEnd);349 else350 ++xEnd;351 if (yBegin > yEnd)352 SwapInt (&yBegin, &yEnd);353 else354 ++yEnd;355 356 347 // Step point by point based on the dominate axis 357 348 … … 378 369 // Compute the x and y offsets for the line width extent 379 370 371 if (xBegin > xEnd) 372 SwapInt (&xBegin, &xEnd); 373 else 374 ++xEnd; 375 if (xBegin < 0) xBegin = 0; 376 if (xEnd > numCols) xEnd = numCols; 377 380 378 yMid = y1 + slope * (xBegin - x1); 381 379 yOffset = fabs (halfWidth * dr / dx); … … 387 385 for (y = yBegin; y != yEnd; ++y) 388 386 { 389 if ( x >=0 && x < numCols &&y >= 0 && y < numRows)387 if (y >= 0 && y < numRows) 390 388 { 391 389 pixel = psAlloc (sizeof(PixelPos)); … … 421 419 // Compute the x and y offsets for the line width extent 422 420 421 if (yBegin > yEnd) 422 SwapInt (&yBegin, &yEnd); 423 else 424 ++yEnd; 425 if (yBegin < 0) yBegin = 0; 426 if (yEnd > numRows) yEnd = numRows; 427 423 428 xMid = x1 + slope * (yBegin - y1); 424 429 xOffset = fabs (halfWidth * dr / dy); … … 430 435 for (x = xBegin; x != xEnd; ++x) 431 436 { 432 if (x >=0 && x < numCols && y >= 0 && y < numRows)437 if (x >=0 && x < numCols) 433 438 { 434 439 pixel = psAlloc (sizeof(PixelPos));
Note:
See TracChangeset
for help on using the changeset viewer.
