| 4485 | } |
| 4486 | |
| 4487 | int PSL_plotpoint (struct PSL_CTRL *PSL, double x, double y, int pen) { |
| 4488 | int ix, iy, idx, idy; |
| 4489 | |
| 4490 | /* Convert user coordinates to dots */ |
| 4491 | ix = psl_ix (PSL, x); |
| 4492 | iy = psl_iy (PSL, y); |
| 4493 | |
| 4494 | if (pen & PSL_REL) { |
| 4495 | /* Relative move or relative draw */ |
| 4496 | if (pen & PSL_STROKE) { |
| 4497 | /* Always draw-stroke even when displacement is 0 */ |
| 4498 | PSL_command (PSL, "%d %d D S\n", ix, iy); |
| 4499 | } |
| 4500 | else if (ix == 0 && iy == 0) |
| 4501 | return (PSL_NO_ERROR); |
| 4502 | else if (pen & PSL_MOVE) |
| 4503 | PSL_command (PSL, "%d %d G\n", ix, iy); |
| 4504 | else |
| 4505 | PSL_command (PSL, "%d %d D\n", ix, iy); |
| 4506 | PSL->internal.ix += ix; /* Update absolute position */ |
| 4507 | PSL->internal.iy += iy; |
| 4508 | } |
| 4509 | else { |
| 4510 | /* Absolute move or absolute draw converted to relative */ |
| 4511 | idx = ix - PSL->internal.ix; |
| 4512 | idy = iy - PSL->internal.iy; |
| 4513 | if (pen & PSL_STROKE) { |
| 4514 | /* Always draw-stroke even when displacement is 0 */ |
| 4515 | PSL_command (PSL, "%d %d D S\n", idx, idy); |
| 4516 | } |
| 4517 | else if (pen & PSL_MOVE) { |
| 4518 | /* Do this always, even if idx = idy = 0, just to be sure we are where we are supposed to be */ |
| 4519 | PSL_command (PSL, "%d %d M\n", ix, iy); |
| 4520 | } |
| 4521 | else if (idx == 0 && idy == 0) |
| 4522 | return (PSL_NO_ERROR); |
| 4523 | else { |
| 4524 | /* Convert to relative draw to have smaller numbers */ |
| 4525 | PSL_command (PSL, "%d %d D\n", idx, idy); |
| 4526 | } |
| 4527 | PSL->internal.ix = ix; /* Update absolute position */ |
| 4528 | PSL->internal.iy = iy; |
| 4529 | } |
| 4530 | return (PSL_NO_ERROR); |
| 4531 | } |
| 4532 | |
| 4533 | int PSL_endplot (struct PSL_CTRL *PSL, int lastpage) { |
| 4534 | /* Finalizes the current plot layer; see PSL_endsession for terminating PSL session. */ |
no test coverage detected