Skip to content
This repository was archived by the owner on Mar 31, 2020. It is now read-only.

Commit 5d26844

Browse files
committed
Canvas coordinate tweak
1 parent 68654d1 commit 5d26844

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/main.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ def __init__(self, *args, **kwds):
2525
self.maxsize(400, 500)
2626

2727
self.window = Window(self)
28-
self.front = View(Front(self.window), 'widget')
29-
28+
self.front = View(
29+
Front(
30+
self.window,
31+
width=self.window.winfo_width(),
32+
height=self.window.winfo_height()
33+
),
34+
'widget'
35+
)
3036
self.window.pack(fill='both', expand=True)
3137
self.window.set_view(self.front)

src/view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@ def get_distance(self, direction: Direction):
102102

103103
@property
104104
def origin(self):
105-
return Coord(0, 0)
105+
return Coord(self.canvasx(0), self.canvasy(0))

0 commit comments

Comments
 (0)