summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog20
-rw-r--r--doc/pic.ms5
-rw-r--r--src/preproc/pic/pic.y29
3 files changed, 45 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index cd9a5ce0..bed6465d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2006-03-21 Werner LEMBERG <wl@gnu.org>
+
+ * src/preproc/pic/pic.y (object_spec THEN): For compatibility with
+ both DWB pic and dpic, make
+
+ right;
+ line then down;
+
+ equal to
+
+ right;
+ line right then down;
+
+ instead of
+
+ right;
+ line 0 then down;
+
+ * doc/pic.ms: Document this.
+
2006-03-20 Werner LEMBERG <wl@gnu.org>
* doc/pic.ms: With permission of Eric Raymond, put it under the
diff --git a/doc/pic.ms b/doc/pic.ms
index 2caa48ee..27fcd1de 100644
--- a/doc/pic.ms
+++ b/doc/pic.ms
@@ -31,7 +31,7 @@
.\" Eric S. Raymond <esr@thyrsus.com> in August 1995. It has been put
.\" under the GPL in March 2006.
.\"
-.\" $Id: pic.ms,v 1.32 2006/03/20 12:59:09 wl Exp $
+.\" $Id: pic.ms,v 1.33 2006/03/21 07:57:57 wl Exp $
.
.
.\" Set a proper TeX and LaTeX
@@ -515,6 +515,9 @@ define zigzag { $1 right 1 then down .5 left 1 then right 1 }
zigzag(line);
.PE
.CE "2: \fBline right 1 then down .5 left 1 then right 1\fP"
+.PP
+If a path starts with \fBthen\fP, the first segment is assumed to be into
+the current direction, using the default length.
.
.NH 2
Spline Objects
diff --git a/src/preproc/pic/pic.y b/src/preproc/pic/pic.y
index ce7a459c..a1a5f8fd 100644
--- a/src/preproc/pic/pic.y
+++ b/src/preproc/pic/pic.y
@@ -878,14 +878,27 @@ object_spec:
| object_spec THEN
{
$$ = $1;
- if ($$->flags & HAS_SEGMENT) {
- $$->segment_list = new segment($$->segment_pos,
- $$->segment_is_absolute,
- $$->segment_list);
- $$->flags &= ~HAS_SEGMENT;
- $$->segment_pos.x = $$->segment_pos.y = 0.0;
- $$->segment_is_absolute = 0;
- }
+ if (!($$->flags & HAS_SEGMENT))
+ switch ($$->dir) {
+ case UP_DIRECTION:
+ $$->segment_pos.y += $$->segment_width;
+ break;
+ case DOWN_DIRECTION:
+ $$->segment_pos.y -= $$->segment_width;
+ break;
+ case RIGHT_DIRECTION:
+ $$->segment_pos.x += $$->segment_width;
+ break;
+ case LEFT_DIRECTION:
+ $$->segment_pos.x -= $$->segment_width;
+ break;
+ }
+ $$->segment_list = new segment($$->segment_pos,
+ $$->segment_is_absolute,
+ $$->segment_list);
+ $$->flags &= ~HAS_SEGMENT;
+ $$->segment_pos.x = $$->segment_pos.y = 0.0;
+ $$->segment_is_absolute = 0;
}
| object_spec SOLID
{