SYSTEM WARNING: Creating default object from empty value

Mantis - Squeak
Viewing Issue Advanced Details
5605 Graphics feature always 12-05-06 06:44 03-07-07 06:52
wiz  
andreas  
normal  
assigned 3.9  
open  
none    
none  
0005605: Squeak oxymorons: MatrixTransform2x3 identity does not behave as an identiy transformation.

For this one in a fresh Sq 7067
evaluate in a workspace:

results :=
{ IdentityTransform identity
. MatrixTransform2x3 identity
 . MorphicTransform identity } collect: [ :each |
    ( -2.0 to: 2.0 by: 0.25 ) collect: [ :eachOne |
          (each globalPointToLocal: (each localPointToGlobal: eachOne asPoint )) ]] .

results explore .

And compare the results.
My results were:

root: {see expanded lists}
    1: {IdentityTransform}
        1: -2.0@-2.0
        2: -1.75@-1.75
        3: -1.5@-1.5
        4: -1.25@-1.25
        5: -1.0@-1.0
        6: -0.75@-0.75
        7: -0.5@-0.5
        8: -0.25@-0.25
        9: 0.0@0.0
        10: 0.25@0.25
        11: 0.5@0.5
        12: 0.75@0.75
        13: 1.0@1.0
        14: 1.25@1.25
        15: 1.5@1.5
        16: 1.75@1.75
        17: 2.0@2.0
    2: {MatrixTransform2x3}
        1: 0@0
        2: 0@0
        3: 0@0
        4: 0@0
        5: 0@0
        6: 0@0
        7: 0@0
        8: 0@0
        9: 0@0
        10: 0@0
        11: 1@1
        12: 1@1
        13: 1@1
        14: 1@1
        15: 2@2
        16: 2@2
        17: 2@2
    3: {MorphicTransform}
        1: -2.0@-2.0
        2: -1.75@-1.75
        3: -1.5@-1.5
        4: -1.25@-1.25
        5: -1.0@-1.0
        6: -0.75@-0.75
        7: -0.5@-0.5
        8: -0.25@-0.25
        9: 0.0@0.0
        10: 0.25@0.25
        11: 0.5@0.5
        12: 0.75@0.75
        13: 1.0@1.0
        14: 1.25@1.25
        15: 1.5@1.5
        16: 1.75@1.75
        17: 2.0@2.0

Now to be fair to MatrixTransform2x3 has two methods for transforming points

#transformPoint:
#invertPoint
which do the transformation w/o "rounding" . Using them in place of
#globalPointToLocal: and #localPointToGlobal in a separate test gives the expected results.

These messages have few senders. And they are not part of the DisplayTransform protocol.
It would make more sense to me it the senses were reversed. With the protocol messages behaving like IdentityMorph and the two messages unique to MatrixTransform2x3 behaving in the unusual way. (i.e. rounding)

I was also surprised to find that in addition to rounding, negative numbers are transformed to 0? What is that in aid of?

MatrixTransform2x3 seem to me to be an oddball. And there seem to be no flags out there to say why and to document how to properly use its behavior.



related to 0006303new  Matrix2x3Plugin does not consider negative numbers when rounding. 
child of 0006511new  Mother of all Morphic Graphical off-by-one/fencepost -error reports. 
child of 0005560new  MatrixTransformationMorph needs examining and fixing. 

Notes
(0008775)
wiz   
12-30-06 02:23   
On more reflection:

The problem seems to be related to doing rounding using
n + 1 truncate. Which works when n is positve but will be off by one or even two when
n = aNegativeInteger + positiveEpsilon . And that seems to be the case here.

So this is really a bug.