cmu-cs-academy / desktop-cmu-graphics

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

Fix bug: Shapes not resizing when screen resizes after upgrade to version 1.1.32 #64

Closed Mohamed-Waiel-Shikfa closed 3 months ago

Mohamed-Waiel-Shikfa commented 3 months ago

Hello,

I am a CS rising sophomore at CMU-Q and part of the CA team for the 15-112 course this summer: 15-112 Staff.

We have noticed an issue where shapes do not resize when the screen is resized after upgrading to version 1.1.32 of cmu_graphics. This behavior was different in previous versions where shapes resized as expected.

The issue seems to have been introduced by the following commit: Commit #54. I'm curious to understand the rationale behind this change and how it was accepted. 😁

If there is a new way to handle this, clarifications would be appreciated.

In the meantime, I have re-added self.redrawAllWrapper() in the onResize() function (line 593) to address the issue.

Thank you for your attention to this matter.

Mohamed-Waiel-Shikfa commented 3 months ago

Here is a simple program to test the bug (try resizing with and without this change and notice the difference for yourself):

from cmu_graphics import*

def redrawAll(app):
    drawRect(app.width/2-app.width/10,app.height/2-app.height/10,app.width/5,app.height/5)

runApp()
schmave commented 3 months ago

Thank you very much for this clear bug report and a fix. We think there may be a better fix that works for both CPCS and non-CPCS graphics mode, so we won't merge this right away. But we will look into it over the next few days and get back to you soon.

Sorry for the bug!