gui: initialize the drawing with the right zoom factor

Fixes #172

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2019-08-21 14:36:00 +10:00 committed by Benjamin Tissoires
parent a8d8641442
commit d633637899
2 changed files with 3 additions and 3 deletions

View File

@ -35,14 +35,14 @@ class Drawing(Gtk.EventBox):
btn_rotate_left = Gtk.Template.Child()
btn_rotate_right = Gtk.Template.Child()
def __init__(self, json_data, *args, **kwargs):
def __init__(self, json_data, zoom, *args, **kwargs):
super().__init__()
self.orientation = Config().orientation
Config().connect('notify::orientation', self._on_orientation_changed)
DATA_PATH.mkdir(parents=True, exist_ok=True)
self.json_data = json_data
self._zoom = 0
self._zoom = zoom
self.refresh() # sets self.svg
self.timestamp = self.svg.timestamp

View File

@ -91,7 +91,7 @@ class DrawingPerspective(Gtk.Stack):
if ts in self.known_drawings:
continue
drawing = Drawing(js)
drawing = Drawing(js, self._zoom)
self.known_drawings[ts] = drawing
# Now pick the right monthly flowbox to insert into