Skip to content

Program crashes upon resizing window to 0 #473

Open
@PsychoticTomato

Description

Describe the bug
When resizing the p5 program window to a state where either the height or the width are zero, the program crashes with a ZeroDivisionError.

To Reproduce
This is my code:

import p5


class DrawSquare():
    def __init__(self):
        p5.size(600, 600)
        p5.no_stroke()
        p5.background(204)


if __name__ == '__main__':
    p5.run(renderer="vispy")
    square = DrawSquare()

Expected behavior
The program keeps running for a second with the window turning black, then crashes.

Screenshots
image

System information:

  • p5 release (version number or latest commit): 0.8.4
  • Python version: 3.10
  • Operating system: Windows

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions