vane / degrafa

Automatically exported from code.google.com/p/degrafa
0 stars 0 forks source link

TransformGroup with multiple child registration points #68

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There is a little "bug" still in the code, i.m.o. When you iterate through the
offsets of each transform you transform each offset point by the
current transformation matrix, which is the result of all the
concatenations of previous transforms in the chain. The problem with
this is that the offset for the n-th transformation is not what the
user has written for that transform; instead is a new point altered by
all the previous transforms.

On the TransformGroup class, on the getTransformFor method, inside the
"for each" you have this line:
     currentOffset = retMatrix.transformPoint(currentOffset);
which alters the registration point for the transformation.

Thank you and hope all this makes sense.

- Edi 

Original issue reported on code.google.com by greg.d...@gmail.com on 4 Dec 2008 at 7:57

GoogleCodeExporter commented 9 years ago

Original comment by greg.d...@gmail.com on 4 Dec 2008 at 7:58

GoogleCodeExporter commented 9 years ago
I suppose this is related to what's affecting my demo here:
http://www.emiltamas.com/2009/02/01/degrafa-transformgroup/ ?

If so, I'll take that as a testcase for the next release.

Original comment by emilta...@gmail.com on 2 Feb 2009 at 6:45

GoogleCodeExporter commented 9 years ago
@emiltamas : I assumed it was related when I read your post - why I mentioned 
it -
alhtough I didn't check that yet. I will use your code as an additional test 
when I
work on this - it will be this week. I have another fix for an unreported bug 
as well
where the transform inheritance is not currently working for TransformGroup with
nested transforms. That will probably go in first unless I can get to the other 
issue
in the next day or so in which case I'll get them both in with the same commit.

Original comment by greg.d...@gmail.com on 2 Feb 2009 at 6:57

GoogleCodeExporter commented 9 years ago
Sounds good. Thanks again!

Original comment by emilta...@gmail.com on 2 Feb 2009 at 7:01

GoogleCodeExporter commented 9 years ago
@emiltamas : I checked what you experienced/described and I'm afraid it is not
actually a bug under the current implementation of transforms in degrafa... nor 
is it
specific to TransformGroup, it applies to the other transforms too. Degrafa
transforms are rendering effects on the individual drawing commands; you can 
use an
arbitrary point to set the transform's origin (centerX/centerY) or a convenient
registrationPoint setting (which overrides any centerX/centerY settings that 
may have
been used). If you change that point then the effect of the transform has no 
'memory'
of an earlier setting and it does not affect the x,y properties of the 
underlying
geometry object. We'll give some thought to potentially addressing this in a 
future
release as an additional feature - can't promise anything at this stage.

Original comment by greg.d...@gmail.com on 5 Feb 2009 at 10:28

GoogleCodeExporter commented 9 years ago
Thanks for the explanation! 
I'll try to work my way around this (I might bug you with an email if I get 
stuck if
you don't mind).

Original comment by emilta...@gmail.com on 5 Feb 2009 at 10:43