summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwl <wl>2007-04-10 08:13:41 +0000
committerwl <wl>2007-04-10 08:13:41 +0000
commit8d471b152225636925b9dcdd4c75079eb0564752 (patch)
treed44b03dfe43d73f9d42192d60a2d14fe5e8f7724 /src
parent4117db05aa876759df8ff64be60535869f7ea6e7 (diff)
downloadgroff-8d471b152225636925b9dcdd4c75079eb0564752.tar.gz
In pic, make rounded boxes work with colors. Reported by Urs Eggli
<Urs.Eggli@zuerich.ch>. * src/preproc/pic/common.h (common_output), src/preproc/pix/output.h (output): Add color parameter to `rounded_box' member function. * src/preproc/pic/common.cpp (common_output::rounded_box): Use it. * src/preproc/pic/object.cpp (box_object::print): Pass `color_fill' to `out->rounded_box'.
Diffstat (limited to 'src')
-rw-r--r--src/preproc/pic/common.cpp8
-rw-r--r--src/preproc/pic/common.h7
-rw-r--r--src/preproc/pic/object.cpp4
-rw-r--r--src/preproc/pic/output.h5
4 files changed, 14 insertions, 10 deletions
diff --git a/src/preproc/pic/common.cpp b/src/preproc/pic/common.cpp
index 47a23cd9..bb4b48f7 100644
--- a/src/preproc/pic/common.cpp
+++ b/src/preproc/pic/common.cpp
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2003, 2007
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -319,9 +320,10 @@ void common_output::solid_arc(const position &cent, double rad,
void common_output::rounded_box(const position &cent, const distance &dim,
- double rad, const line_type &lt, double fill)
+ double rad, const line_type &lt,
+ double fill, char *color_fill)
{
- if (fill >= 0.0)
+ if (fill >= 0.0 || color_fill)
filled_rounded_box(cent, dim, rad, fill);
switch (lt.type) {
case line_type::invisible:
diff --git a/src/preproc/pic/common.h b/src/preproc/pic/common.h
index 50238344..6979fa2f 100644
--- a/src/preproc/pic/common.h
+++ b/src/preproc/pic/common.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 1993, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 1993, 2003, 2007
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -53,7 +53,8 @@ protected:
const line_type &);
void solid_rounded_box(const position &, const distance &, double,
const line_type &);
- void filled_rounded_box(const position &, const distance &, double, double);
+ void filled_rounded_box(const position &, const distance &, double,
+ double);
public:
void start_picture(double sc, const position &ll, const position &ur) = 0;
void finish_picture() = 0;
@@ -68,7 +69,7 @@ public:
void ellipse(const position &, const distance &,
const line_type &, double) = 0;
void rounded_box(const position &, const distance &, double,
- const line_type &, double);
+ const line_type &, double, char *);
void set_color(char *, char *) = 0;
void reset_color() = 0;
char *get_last_filled() = 0;
diff --git a/src/preproc/pic/object.cpp b/src/preproc/pic/object.cpp
index be9ad727..2eeb9cde 100644
--- a/src/preproc/pic/object.cpp
+++ b/src/preproc/pic/object.cpp
@@ -1,6 +1,6 @@
// -*- C++ -*-
/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004, 2005,
- 2006
+ 2006, 2007
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -783,7 +783,7 @@ void box_object::print()
}
else {
distance abs_dim(fabs(dim.x), fabs(dim.y));
- out->rounded_box(cent, abs_dim, fabs(xrad), lt, fill);
+ out->rounded_box(cent, abs_dim, fabs(xrad), lt, fill, color_fill);
}
out->reset_color();
}
diff --git a/src/preproc/pic/output.h b/src/preproc/pic/output.h
index aa03e776..2e837c30 100644
--- a/src/preproc/pic/output.h
+++ b/src/preproc/pic/output.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2007
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -54,7 +55,7 @@ public:
virtual void ellipse(const position &, const distance &,
const line_type &, double) = 0;
virtual void rounded_box(const position &, const distance &, double,
- const line_type &, double) = 0;
+ const line_type &, double, char *) = 0;
virtual void command(const char *, const char *, int) = 0;
virtual void set_location(const char *, int) {}
virtual void set_color(char *, char *) = 0;