line_width.c 782 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*!
  2. \file lib/cairodriver/line_width.c
  3. \brief GRASS cairo display driver - set line width
  4. (C) 2007-2008 by Lars Ahlzen and the GRASS Development Team
  5. This program is free software under the GNU General Public License
  6. (>=v2). Read the file COPYING that comes with GRASS for details.
  7. \author Lars Ahlzen <lars ahlzen.com> (original contibutor)
  8. \author Glynn Clements
  9. */
  10. #include <grass/gis.h>
  11. #include "cairodriver.h"
  12. #define MIN_WIDTH 1
  13. static double previous_width = -1;
  14. /*!
  15. \brief Set line width
  16. \param width line width (double precision)
  17. */
  18. void Cairo_Line_width(double width)
  19. {
  20. G_debug(1, "Cairo_Line_width: %f", width);
  21. width = MAX(MIN_WIDTH, width);
  22. if (width != previous_width)
  23. cairo_set_line_width(cairo, width);
  24. return;
  25. }