Mantis - tweak
Viewing Issue Advanced Details
1126 Any minor always 04-28-05 03:58 04-28-05 23:16
tedka  
 
normal  
resolved  
fixed  
none    
none  
0001126: CMatrixTransform gets divide by zero error
During innocent use of a CPolygonPlayer, I got a divide by zero error. Just evaluate this code to see it.

| oldBox newBox |
oldBox := 17.38304088577985@3 corner: 17.38304088577985@168. /> newBox := 3@3 corner: 31.0@168.
CMatrixTransform localRect: oldBox toGlobal: newBox.

It happened during (CPolygonPlayer onBorderChanged), and the polygon was a triangle pointing straight up. It was an arrowhead.

Notes
(0001439)
andreas   
04-28-05 05:11   
Well, yes, trying to create a transform which scales from a zero-width rectangle up to a non-zero width rectangle will result in a division by zero. Unless I am missing something I don't see the bug here.
(0001445)
tedka   
04-28-05 23:10   
Just execute this to see the problem. This is what a pen does to get an arrowhead on the end of a trail.

(CPolygonPlayer new) vertices: {100@100. 130@100}; closed: false; borderWidth: 5; arrowStyle: #forward; arrowForms
(0001446)
andreas   
04-28-05 23:16   
Now fixed. Thanks for reporting.