}
void Gfx::doEndPath() {
- if (state->isPath() && clip != clipNone) {
+ if (state->isCurPt() && clip != clipNone) {
state->clip();
if (clip == clipNormal) {
out->clip(state);
double riseX, riseY;
CharCode code;
Unicode u[8];
- double x, y, dx, dy, dx2, dy2, curX, curY, tdx, tdy;
+ double x, y, dx, dy, dx2, dy2, curX, curY, tdx, tdy, lineX, lineY;
double originX, originY, tOriginX, tOriginY;
double oldCTM[6], newCTM[6];
double *mat;
state->textTransformDelta(0, state->getRise(), &riseX, &riseY);
curX = state->getCurX();
curY = state->getCurY();
+ lineX = state->getLineX();
+ lineY = state->getLineY();
oldParser = parser;
p = s->getCString();
len = s->getLength();
state = state->restore();
out->restoreState(state);
// GfxState::restore() does *not* restore the current position,
- // so we track it here with (curX, curY)
+ // so we deal with it here using (curX, curY) and (lineX, lineY)
curX += tdx;
curY += tdy;
state->moveTo(curX, curY);
+ state->textSetPos(lineX, lineY);
p += n;
len -= n;
}