Skip to content

Commit

Permalink
fixed one scale bug where between 1 and 2 resulted in no actua scaling
Browse files Browse the repository at this point in the history
Conflicts:
	printrun/projectlayer.py
  • Loading branch information
garyhodgson authored and iXce committed Aug 15, 2013
1 parent 38d6ab5 commit b07f785
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions printrun/projectlayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def draw_layer(self, image):

if self.slicer == 'Slic3r' or self.slicer == 'Skeinforge':

if int(self.scale) != 1:
if self.scale != 1.0:
layercopy = copy.deepcopy(image)
height = float(layercopy.get('height').replace('m',''))
width = float(layercopy.get('width').replace('m',''))
Expand All @@ -101,7 +101,7 @@ def draw_layer(self, image):
g = layercopy.find("{http://www.w3.org/2000/svg}g")
g.set('transform', 'scale('+str(self.scale)+')')
stream = cStringIO.StringIO(PNGSurface.convert(dpi=self.dpi, bytestring=xml.etree.ElementTree.tostring(layercopy)))
else:
else:
stream = cStringIO.StringIO(PNGSurface.convert(dpi=self.dpi, bytestring=xml.etree.ElementTree.tostring(image)))

image = wx.ImageFromStream(stream)
Expand Down Expand Up @@ -325,13 +325,13 @@ def __init__(self, parent, printer=None):
# Right Column

fieldsizer.Add(wx.StaticText(self.panel, -1, "X (px):"), pos=(0, 2), flag=wx.ALIGN_CENTER_VERTICAL)
self.X = wx.SpinCtrl(self.panel, -1, str(int(self._get_setting("project_x", 1024))), max=999999, size=(80,-1))
self.X = wx.SpinCtrl(self.panel, -1, str(int(self._get_setting("project_x", 1920))), max=999999, size=(80,-1))
self.X.Bind(wx.EVT_SPINCTRL, self.update_resolution)
self.X.SetHelpText("The projector resolution in the X axis.")
fieldsizer.Add(self.X, pos=(0, 3))

fieldsizer.Add(wx.StaticText(self.panel, -1, "Y (px):"), pos=(1, 2), flag=wx.ALIGN_CENTER_VERTICAL)
self.Y = wx.SpinCtrl(self.panel, -1, str(int(self._get_setting("project_y", 768))), max=999999, size=(80,-1))
self.Y = wx.SpinCtrl(self.panel, -1, str(int(self._get_setting("project_y", 1200))), max=999999, size=(80,-1))
self.Y.Bind(wx.EVT_SPINCTRL, self.update_resolution)
self.Y.SetHelpText("The projector resolution in the Y axis.")
fieldsizer.Add(self.Y, pos=(1, 3))
Expand All @@ -349,7 +349,7 @@ def __init__(self, parent, printer=None):
fieldsizer.Add(self.offset_Y, pos=(3, 3))

fieldsizer.Add(wx.StaticText(self.panel, -1, "ProjectedX (mm):"), pos=(4, 2), flag=wx.ALIGN_CENTER_VERTICAL)
self.projected_X_mm = floatspin.FloatSpin(self.panel, -1, value=self._get_setting("project_projected_x", 415.0), increment=1, digits=1, size=(80,-1))
self.projected_X_mm = floatspin.FloatSpin(self.panel, -1, value=self._get_setting("project_projected_x", 560.0), increment=1, digits=1, size=(80,-1))
self.projected_X_mm.Bind(floatspin.EVT_FLOATSPIN, self.update_projected_Xmm)
self.projected_X_mm.SetHelpText("The actual width of the entire projected image. Use the Calibrate grid to show the full size of the projected image, and measure the width at the same level where the slice will be projected onto the resin.")
fieldsizer.Add(self.projected_X_mm, pos=(4, 3))
Expand Down

0 comments on commit b07f785

Please sign in to comment.