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

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

Return to bug 141242