mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.6 KiB

  1. --- kpdf/xpdf/splash/SplashXPathScanner.cc (Revision 505052)
  2. +++ ./kpdf/xpdf/splash/SplashXPathScanner.cc (Arbeitskopie)
  3. @@ -186,7 +186,7 @@ GBool SplashXPathScanner::getNextSpan(in
  4. }
  5. void SplashXPathScanner::computeIntersections(int y) {
  6. - SplashCoord ySegMin, ySegMax, xx0, xx1;
  7. + SplashCoord xSegMin, xSegMax, ySegMin, ySegMax, xx0, xx1;
  8. SplashXPathSeg *seg;
  9. int i, j;
  10. @@ -236,19 +236,27 @@ void SplashXPathScanner::computeIntersec
  11. } else if (seg->flags & splashXPathVert) {
  12. xx0 = xx1 = seg->x0;
  13. } else {
  14. - if (ySegMin <= y) {
  15. - // intersection with top edge
  16. - xx0 = seg->x0 + ((SplashCoord)y - seg->y0) * seg->dxdy;
  17. + if (seg->x0 < seg->x1) {
  18. + xSegMin = seg->x0;
  19. + xSegMax = seg->x1;
  20. } else {
  21. - // x coord of segment endpoint with min y coord
  22. - xx0 = (seg->flags & splashXPathFlip) ? seg->x1 : seg->x0;
  23. + xSegMin = seg->x1;
  24. + xSegMax = seg->x0;
  25. }
  26. - if (ySegMax >= y + 1) {
  27. - // intersection with bottom edge
  28. - xx1 = seg->x0 + ((SplashCoord)y + 1 - seg->y0) * seg->dxdy;
  29. - } else {
  30. - // x coord of segment endpoint with max y coord
  31. - xx1 = (seg->flags & splashXPathFlip) ? seg->x0 : seg->x1;
  32. + // intersection with top edge
  33. + xx0 = seg->x0 + ((SplashCoord)y - seg->y0) * seg->dxdy;
  34. + // intersection with bottom edge
  35. + xx1 = seg->x0 + ((SplashCoord)y + 1 - seg->y0) * seg->dxdy;
  36. + // the segment may not actually extend to the top and/or bottom edges
  37. + if (xx0 < xSegMin) {
  38. + xx0 = xSegMin;
  39. + } else if (xx0 > xSegMax) {
  40. + xx0 = xSegMax;
  41. + }
  42. + if (xx1 < xSegMin) {
  43. + xx1 = xSegMin;
  44. + } else if (xx1 > xSegMax) {
  45. + xx1 = xSegMax;
  46. }
  47. }
  48. if (xx0 < xx1) {