Graphics>>Rectangle>>intersects: erroneous code 
Author Message
 Graphics>>Rectangle>>intersects: erroneous code

In the process of examining graphics primitive failures where line segments
extend beyond the 32K, I discovered that the method for


appears to be in error. The current method

        ^ origin < aRectangle corner
                and: [aRectangle origin <  corner
                and: [ origin < corner
                and: [aRectangle origin < aRectangle corner]]]

appears to fail for aRectangle specified by Upper Left and Lower Right (or
lines with negative slope). My corrected method reads:

        (origin x min: corner x) > (aRectangle origin x max: aRectangle corner x)
                ifTrue: [ ^false ]. "aRect is entirely left of self"
        (origin x max: corner x) < (aRectangle origin x min: aRectangle corner x)
                ifTrue: [ ^false ]. "aRect is entirely right of self"
        (origin y max: corner y) < (aRectangle origin y min: aRectangle corner y)
                ifTrue: [ ^false ]. "aRect is entirely above self"
        (origin y min: corner y) > (aRectangle origin y max: aRectangle corner y)
                ifTrue: [ ^false ]. "aRect is entirely below self"

I will be forwarding this to ObjectShare via our project's designated

Wed, 18 Jun 1902 08:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. HELP>>>>>>>Fortran-Pascal Linking

2. >>>>>>>FROM SMTK TO C++

3. ><><><><>Heeeeeeeeeeeeeeelp on INT 14!><><><><><>

4. <<<<<YOU MUST CHECK THIS OUT >>>>>>>>>> 2103

5. >>>>>AVL tree

6. >>>>>How to read a IMAGE file?(BMP, GIF)|||||||||

7. ANNOUNCE>>>>>TOTAL FrameWork from Cincom

8. Slow/No Speed>>>>>>>>>

9. >>>>VHDL tutorial text: Summary >>>>

10. **>>CO Smalltalk Developer!!>>**

11. Multi band report - parent >>child >>stepchild

12. Clipper 53->53a->53b Update-ActualizaciĆ³n Clipper53->53a->53b


Powered by phpBB® Forum Software