[BUG] nested transforms don't work right
Ned Konz
ned at bike-nomad.com
Fri Mar 9 19:17:29 UTC 2001
I've just found what appears to be a bug with nested transforms where:
* inner has a rotation but no scale
* outer has only an offset
Here's a Workspace session that demonstrates this:
m _ Morph new.
m openInWorld.
m position: 100 at 100.
t _ m transformFrom: m world." an IdentityTransform"
(t localPointToGlobal: m center)" 125 at 120"
f _ m addFlexShell.
t _ m transformFrom: m world." a MorphicTransform(angle = 0.0; scale =
1.0; offset = -125 at -120)"
(t localPointToGlobal: m center)" 125 at 120"
f angle: 45.0.
t _ m transformFrom: m world." a MorphicTransform(angle = 45.0; scale =
1.0; offset = -125 at -120)"
(t localPointToGlobal: m center)" 125.0 at 120.0"
"Now look at this: adding a shell hasn't moved the morph at all. But its
transform
reports that its center has shifted to negative land:"
ff _ f addFlexShell.
t _ m transformFrom: m world." a MorphicTransform(angle = 45.0; scale =
1.0; offset = 123 at 118)"
(t localPointToGlobal: m center)" -123.0 at -118.0"
"Ah, but if we change the scale to something other than 1, everything's
happy:"
ff scale: 1.000001.
t _ m transformFrom: m world." a CompositeTransform"
(t localPointToGlobal: m center)" 125.000001 at 120.000001"
ff delete
More information about the Squeak-dev
mailing list
|