enthought / chaco

Chaco is a Python package for building interactive and custom 2-D plots.
http://docs.enthought.com/chaco/
Other
291 stars 101 forks source link

fix gc undeclare #883

Closed homosapien-lcy closed 1 year ago

homosapien-lcy commented 1 year ago

Found that the gc (GraphicsContext) is referenced before construction in the line 136. This has caused the test chaco/chaco/examples/demo/simple_polar.py to fail. The solution is to find the gc in the context. A gc context is actually conveniently included in the *args, thus retrieving that gc as GraphicContext to solve the problem. closes #875

dpinte commented 1 year ago

For reference, the prototype of the _draw_plot method is defined here: https://github.com/enthought/enable/blob/main/enable/component.py#L807. You could even remove the *arg and **kwargs in favour of the ones from the prototype.