From f758357d8d3fcf828846c2f9b6f5d6e5e5f1c5d5 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Tue, 31 Mar 2020 09:22:28 -0400 Subject: [PATCH] Made DrawLines more efficient --- PySimpleGUI.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 5dc8e272..969e0680 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 -version = __version__ = "4.18.0.7 Unreleased - Print and MLine.Print fixed sep char handling, popup_get_date, icon parm popup_animated, popup button size (6,1), NEW CALENDAR chooser integrated, Graph.draw_lines" +version = __version__ = "4.18.0.8 Unreleased - Print and MLine.Print fixed sep char handling, popup_get_date, icon parm popup_animated, popup button size (6,1), NEW CALENDAR chooser integrated, Graph.draw_lines" port = 'PySimpleGUI' @@ -3758,13 +3758,12 @@ class Graph(Element): """ converted_points = [self._convert_xy_to_canvas_xy(point[0], point[1]) for point in points] - if self._TKCanvas2 is None: - print('*** WARNING - The Graph element has not been finalized and cannot be drawn upon ***') - print('Call Window.Finalize() prior to this operation') - return None try: # in case window was closed with an X id = self._TKCanvas2.create_line(*converted_points, width=width, fill=color) except: + if self._TKCanvas2 is None: + print('*** WARNING - The Graph element has not been finalized and cannot be drawn upon ***') + print('Call Window.Finalize() prior to this operation') id = None return id