Merge pull request #2497 from PySimpleGUI/Dev-latest

Correctly scale draw_pixel
This commit is contained in:
PySimpleGUI 2020-01-10 12:24:47 -05:00 committed by GitHub
commit 56ef311581
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3
version = __version__ = "4.15.1 Released 09-Jan-2020"
version = __version__ = "4.15.1.1 Unreleased - Fix for draw_pixel"
port = 'PySimpleGUI'
@ -3155,8 +3155,13 @@ class Graph(Element):
print('Call Window.Finalize() prior to this operation')
return None
try: # needed in case window was closed with an X
id = self._TKCanvas2.create_oval(converted_point[0] - size, converted_point[1] - size,
converted_point[0] + size, converted_point[1] + size, fill=color,
point1 = converted_point[0] - size // 2, converted_point[1] - size // 2
point2 = converted_point[0] + size // 2, converted_point[1] + size // 2
# print(f'point size = {size} points = {point1} and {point2}')
id = self._TKCanvas2.create_oval(point1[0], point1[1],
point2[0], point2[1],
width=0,
fill=color,
outline=color)
except:
id = None