View | Details | Raw Unified | Return to bug 141242
Collapse All | Expand All

(-)kpdf/xpdf/splash/SplashXPathScanner.cc (-12 / +20 lines)
Lines 186-192 GBool SplashXPathScanner::getNextSpan(in Link Here
186
}
186
}
187
187
188
void SplashXPathScanner::computeIntersections(int y) {
188
void SplashXPathScanner::computeIntersections(int y) {
189
  SplashCoord ySegMin, ySegMax, xx0, xx1;
189
  SplashCoord xSegMin, xSegMax, ySegMin, ySegMax, xx0, xx1;
190
  SplashXPathSeg *seg;
190
  SplashXPathSeg *seg;
191
  int i, j;
191
  int i, j;
192
192
Lines 236-254 void SplashXPathScanner::computeIntersec Link Here
236
    } else if (seg->flags & splashXPathVert) {
236
    } else if (seg->flags & splashXPathVert) {
237
      xx0 = xx1 = seg->x0;
237
      xx0 = xx1 = seg->x0;
238
    } else {
238
    } else {
239
      if (ySegMin <= y) {
239
      if (seg->x0 < seg->x1) {
240
	// intersection with top edge
240
	xSegMin = seg->x0;
241
	xx0 = seg->x0 + ((SplashCoord)y - seg->y0) * seg->dxdy;
241
	xSegMax = seg->x1;
242
      } else {
242
      } else {
243
	// x coord of segment endpoint with min y coord
243
	xSegMin = seg->x1;
244
	xx0 = (seg->flags & splashXPathFlip) ? seg->x1 : seg->x0;
244
	xSegMax = seg->x0;
245
      }
245
      }
246
      if (ySegMax >= y + 1) {
246
      // intersection with top edge
247
	// intersection with bottom edge
247
      xx0 = seg->x0 + ((SplashCoord)y - seg->y0) * seg->dxdy;
248
	xx1 = seg->x0 + ((SplashCoord)y + 1 - seg->y0) * seg->dxdy;
248
      // intersection with bottom edge
249
      } else {
249
      xx1 = seg->x0 + ((SplashCoord)y + 1 - seg->y0) * seg->dxdy;
250
	// x coord of segment endpoint with max y coord
250
      // the segment may not actually extend to the top and/or bottom edges
251
	xx1 = (seg->flags & splashXPathFlip) ? seg->x0 : seg->x1;
251
      if (xx0 < xSegMin) {
252
	xx0 = xSegMin;
253
      } else if (xx0 > xSegMax) {
254
	xx0 = xSegMax;
255
      }
256
      if (xx1 < xSegMin) {
257
	xx1 = xSegMin;
258
      } else if (xx1 > xSegMax) {
259
	xx1 = xSegMax;
252
      }
260
      }
253
    }
261
    }
254
    if (xx0 < xx1) {
262
    if (xx0 < xx1) {

Return to bug 141242