Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions plotdevice/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,9 @@ class ExportSheet(NSObject):
def awakeFromNib(self):
self.formats = dict(image=(0, 'pdf', 0,0, 'png', 'jpg', 'heic', 'tiff', 'gif', 0,0, 'pdf', 'eps'), movie=('mov', 'mov', 'gif'))
self.movie = dict(format='mov', first=1, last=150, fps=30, bitrate=1, loop=0, codec=0)
self.image = dict(format='pdf', zoom=100, first=1, last=1, cmyk=False, single=True)
self.image = dict(format='pdf', zoom=1.0, first=1, last=1, cmyk=False, single=True)
self.last = None


@objc.python_method
def beginExport(self, kind):
# configure the accessory controls
Expand Down Expand Up @@ -464,7 +463,7 @@ def imageState(self, key=None):
fmts = self.formats['image']
fmt_idx = self.imageFormat.indexOfSelectedItem()
state = dict(format=fmts[fmt_idx],
zoom=self.image['zoom'] / 100,
zoom=self.image['zoom'],
first=1,
cmyk=self.imageCMYK.state()==NSOnState,
single=fmt_idx==1,
Expand Down Expand Up @@ -497,24 +496,24 @@ def imageZoomStepped_(self, sender):
sender.setIntValue_(0)

self.imageZoomChanged_(None) # reflect any editing in text field
pct = self.image['zoom']
pct = self.image['zoom'] * 100

if step > 0:
pct = 100 * ceil((pct + 1) / 100)
elif step < 0:
pct = 100 * floor((pct - 1) / 100)

if 0 < pct < 10000:
self.image['zoom'] = pct
self.image['zoom'] = pct / 100
self.imageZoom.setStringValue_("%i%%" % pct)

@IBAction
def imageZoomChanged_(self, sender):
pct = self.imageZoom.intValue()
if pct > 0:
self.image['zoom'] = pct
self.image['zoom'] = pct / 100
else:
pct = self.image['zoom']
pct = self.image['zoom'] * 100
self.imageZoom.setStringValue_("%i%%" % pct)

@IBAction
Expand Down