123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- #include "sys-defines.h"
- #include "extern.h"
- bool
- _pl_t_path_is_flushable (S___(Plotter *_plotter))
- {
- return false;
- }
- enum { ACCEPTED = 0x1, CLIPPED_FIRST = 0x2, CLIPPED_SECOND = 0x4 };
- void
- _pl_t_maybe_prepaint_segments (R___(Plotter *_plotter) int prev_num_segments)
- {
- int i;
-
- if (_plotter->drawstate->path->num_segments < 2)
- return;
- if (_plotter->drawstate->path->num_segments == prev_num_segments)
-
- return;
-
- if (_plotter->drawstate->pen_type == 0)
- return;
-
- if (_plotter->tek_display_type != TEK_DPY_KERMIT
- && _plotter->drawstate->fgcolor.red == 0xffff
- && _plotter->drawstate->fgcolor.green == 0xffff
- && _plotter->drawstate->fgcolor.blue == 0xffff)
- return;
-
- for (i = IMAX(1, prev_num_segments);
- i < _plotter->drawstate->path->num_segments;
- i++)
- {
- plPoint start, end;
- plIntPoint istart, iend;
- int clipval;
- bool same_point, force;
-
- start.x = XD(_plotter->drawstate->path->segments[i-1].p.x,
- _plotter->drawstate->path->segments[i-1].p.y);
- start.y = YD(_plotter->drawstate->path->segments[i-1].p.x,
- _plotter->drawstate->path->segments[i-1].p.y);
- end.x = XD(_plotter->drawstate->path->segments[i].p.x,
- _plotter->drawstate->path->segments[i].p.y);
- end.y = YD(_plotter->drawstate->path->segments[i].p.x,
- _plotter->drawstate->path->segments[i].p.y);
- same_point = (start.x == end.x && start.y == end.y) ? true : false;
-
- clipval = _clip_line (&start.x, &start.y, &end.x, &end.y,
- TEK_DEVICE_X_MIN_CLIP, TEK_DEVICE_X_MAX_CLIP,
- TEK_DEVICE_Y_MIN_CLIP, TEK_DEVICE_Y_MAX_CLIP);
- if (!(clipval & ACCEPTED))
- continue;
-
- istart.x = IROUND(start.x);
- istart.y = IROUND(start.y);
- iend.x = IROUND(end.x);
- iend.y = IROUND(end.y);
- if (i == 1)
-
- _pl_t_tek_move (R___(_plotter) istart.x, istart.y);
- else
-
- {
- int correct_tek_mode =
- _plotter->drawstate->points_are_connected ? TEK_MODE_PLOT : TEK_MODE_POINT;
- if (_plotter->tek_position_is_unknown
- || _plotter->tek_pos.x != istart.x
- || _plotter->tek_pos.y != istart.y
- || _plotter->tek_mode_is_unknown
- || _plotter->tek_mode != correct_tek_mode)
-
- _pl_t_tek_move (R___(_plotter) istart.x, istart.y);
- }
-
-
- _pl_t_set_attributes (S___(_plotter));
- _pl_t_set_pen_color (S___(_plotter));
- _pl_t_set_bg_color (S___(_plotter));
-
- if (i == 1
- && (same_point == false
- || (same_point == true
- && _plotter->drawstate->cap_type == PL_CAP_ROUND)))
- force = true;
- else
- force = false;
-
- _pl_t_tek_vector_compressed (R___(_plotter)
- iend.x, iend.y, istart.x, istart.y, force);
-
-
- _plotter->tek_pos.x = iend.x;
- _plotter->tek_pos.y = iend.y;
- }
- }
|