m_mark.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* This file is part of the GNU plotutils package. Copyright (C) 1995,
  2. 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc.
  3. The GNU plotutils package is free software. You may redistribute it
  4. and/or modify it under the terms of the GNU General Public License as
  5. published by the Free Software foundation; either version 2, or (at your
  6. option) any later version.
  7. The GNU plotutils package is distributed in the hope that it will be
  8. useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. General Public License for more details.
  11. You should have received a copy of the GNU General Public License along
  12. with the GNU plotutils package; see the file COPYING. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor,
  14. Boston, MA 02110-1301, USA. */
  15. /* The paint_marker method, which is an internal function that is called
  16. when the marker() method is invoked. It plots an object: a marker of a
  17. specified type, at a specified size, at the current location.
  18. If this returns `false', marker() will construct the marker from other
  19. libplot primitives, in a generic way. */
  20. #include "sys-defines.h"
  21. #include "extern.h"
  22. bool
  23. _pl_m_paint_marker (R___(Plotter *_plotter) int type, double size)
  24. {
  25. _pl_m_set_attributes (R___(_plotter)
  26. PL_ATTR_TRANSFORMATION_MATRIX
  27. | PL_ATTR_PEN_COLOR | PL_ATTR_PEN_TYPE);
  28. _pl_m_emit_op_code (R___(_plotter) O_FMARKER);
  29. _pl_m_emit_float (R___(_plotter) _plotter->drawstate->pos.x);
  30. _pl_m_emit_float (R___(_plotter) _plotter->drawstate->pos.y);
  31. _pl_m_emit_integer (R___(_plotter) type);
  32. _pl_m_emit_float (R___(_plotter) size);
  33. _pl_m_emit_terminator (S___(_plotter));
  34. _plotter->meta_pos = _plotter->drawstate->pos;
  35. return true;
  36. }