GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
cairodriver/line_width.c
Go to the documentation of this file.
1 /*!
2  \file lib/cairodriver/line_width.c
3 
4  \brief GRASS cairo display driver - set line width
5 
6  (C) 2007-2008 by Lars Ahlzen and the GRASS Development Team
7 
8  This program is free software under the GNU General Public License
9  (>=v2). Read the file COPYING that comes with GRASS for details.
10 
11  \author Lars Ahlzen <lars ahlzen.com> (original contibutor)
12  \author Glynn Clements
13 */
14 
15 #include "cairodriver.h"
16 
17 #define MIN_WIDTH 1
18 
19 #ifndef MAX
20 #define MAX(a,b) ((a)>(b)?(a):(b))
21 #endif
22 
23 static double previous_width = -1;
24 
25 /*!
26  \brief Set line width
27 
28  \param width line width (double precision)
29 */
30 void Cairo_Line_width(double width)
31 {
32  G_debug(1, "Cairo_Line_width: %f", width);
33 
34  width = MAX(MIN_WIDTH, width);
35  if (width != previous_width)
36  cairo_set_line_width(cairo, width);
37 
38  return;
39 }
void Cairo_Line_width(double width)
Set line width.
cairo_t * cairo
#define MIN_WIDTH
GRASS cairo display driver - header file.
#define MAX(a, b)
int G_debug(int, const char *,...) __attribute__((format(printf