|
From: <J.B...@ew...> - 2008-04-17 09:33:08
|
> -----Original Message-----
> From: njh [mailto:nj...@nj...]
> Sent: woensdag 16 april 2008 18:55
> To: Engelen, J.B.C. (Johan)
> Cc: jf....@gm...; lib...@li...
> Subject: Re: path::toPwSb for closed paths
>
> On Wed, 16 Apr 2008 J.B...@ew... wrote:
>
> > Hi all,
> >
> > Have a look at rev. 1175. I think I made a mistake there.
> Right now, the closing segment of a closed path is not added
> to pwd2. So LPEs do not function correctly with closed paths.
> > I can't remember why I did rev. 1175; it does not say which
> bug specifically it is supposed to fix.
> >
> > Do you guys think rev 1175 should be reverted?
>
> Are you referring to
> Index: src/path.h
> ===================================================================
> --- src/path.h (revision 1174)
> +++ src/path.h (working copy)
> @@ -492,7 +492,8 @@
> Piecewise<D2<SBasis> > ret;
> ret.push_cut(0);
> unsigned i = 1;
> - for(const_iterator it = begin(); it != end_default();
> ++it, i++) {
> + // ignore that path is closed or open. pw<d2<>> is always open.
> + for(const_iterator it = begin(); it != end(); ++it, i++) {
> ret.push(it->toSBasis(), i);
> }
> return ret;
>
> We have argued endlessly about the semantics of closed and
> open paths.
> Paths have a flag to say whether they are open or closed,
> whereas d2<pw> does not have that notion. This is because
> the correct behaviour when transforming a d2<pw> is not
> always clear wrt the closing segment. For example, the
> closing segment is always a line, but if we have a transform
> which does not preserve lines then should we transform that
> last line? I would argue yes in many cases. Thus, we should
> include the last line segment as a linear() in the d2.
>
> Looking at the code, I would say that
> - for(const_iterator it = begin(); it != end_default();
> ++it, i++) {
> is correct. I don't know why you made the change - there
> might be a bug elsewhere that this obscured (*gasp*).
I just changed it back. It fixes Inkscape's LPE bug.
Thanks,
Johan
|