cmu-cs-academy / desktop-cmu-graphics

BSD 3-Clause "New" or "Revised" License
15 stars 9 forks source link

Fix a couple bugs in containsShape #56

Closed austin-schick closed 8 months ago

austin-schick commented 8 months ago

This code was crashing on Desktop CMU Graphics before, and will now succeed:

from cmu_graphics import *
i = Rect(200,200,50,50)

r = Oval(5,5,10,10)
g = Group(r,Line(1,1,8,8,fill='blue'),Line(1,8,8,1,fill='green'))
def onMouseMove(x,y):
    g.centerX, g.centerY = x,y
    if i.containsShape(g):
        r.fill = 'red'
    else: r.fill = 'black'

cmu_graphics.run()

I created a ticket for adding better containsShape tests.

schmave commented 8 months ago

The new test is failing for some reason; fix that. Also, the new test should be added to the web tests and copied over via script instead of being manually added here.

schmave commented 8 months ago

I spent some time trying to get the desktop CMU graphics tests in sync with the web ones, but there is still some work to do there. I pushed my work in progress to a branch named sync-tests and will make a Jira task for finishing it.

schmave commented 8 months ago

Green build! Good call on skipping the failing mac tests. Once that cairo text bug is fixed I think we will be able to put them back.