def fitToSidebearing(self, givenLayer, givenMaster):
		try:
			nudgeExcess = True if self.w.excessRadio.get() == 0 else False
			boundL = givenLayer.bounds.origin.x
			boundR = boundL + givenLayer.bounds.size.width
			for thisPath in givenLayer.paths:
				numOfNodes = len(thisPath.nodes)
				for i in range(numOfNodes):
					node = thisPath.nodes[i]
					interesting = False
					if node.type == 1 or node.type == 35:
						if node.x < 0 and nudgeExcess:
							interesting = True
							offsetX = -node.x
						elif (0 < node.x) and (node.x == boundL):
							interesting = True
							offsetX = -node.x
						elif (node.x == boundR) and (node.x < givenLayer.width):
							interesting = True
							offsetX = givenLayer.width - node.x
						elif givenLayer.width < node.x and nudgeExcess:
							interesting = True
							offsetX = givenLayer.width - node.x
						if interesting:
							nodeBefore = thisPath.nodes[i-1]
							if nodeBefore.type == 65:
								if thisPath.nodes[i-2].type == 65: # if two previous nodes are 65 (offcurve)
									oncurveMv = node
									offcurve1 = nodeBefore
									offcurve2 = thisPath.nodes[i-2]
									oncurveSt = thisPath.nodes[i-3]
									self.nudgeCurve(oncurveMv, offcurve1, offcurve2, oncurveSt, offsetX) # only moves offcurve
							nodeAfter = thisPath.nodes[i+1]
							if nodeAfter.type == 65:
								if thisPath.nodes[i+2].type ==65: # if two next nodes are 65 (offcurve)
									oncurveMv = node
									offcurve1 = nodeAfter
									offcurve2 = thisPath.nodes[i+2]
									oncurveSt = thisPath.nodes[i+3]
									self.nudgeCurve(oncurveMv, offcurve1, offcurve2, oncurveSt, offsetX) # only moves offcurve
							node.x += offsetX # on curve node moves here
			if nudgeExcess == False: # if Trim Option is on
				wi = givenLayer.width
				slant = givenMaster.italicAngle
				slantOrigin = givenMaster.xHeight / 2
				if slant == 0:
					(difBottom, difTop) = 0, 0
				else:
					difTop = math.tan(math.radians(slant)) * (3000-slantOrigin)
					difBottom = -( math.tan(math.radians(slant)) * (slantOrigin+3000) )
				eraserRectNodes = [
					[[-3000+difBottom,-3000],[0+difBottom,-3000],[0+difTop,3000],[-3000+difTop,3000]],
					[[wi+difBottom,-3000],[wi+3000+difBottom,-3000],[wi+3000+difTop,3000],[wi+difTop,3000]]
				]
				Erasers = NSMutableArray.alloc().init()
				for eraser in eraserRectNodes:
					eraserRect = GSPath()
					for node in eraser:
						newNode = GSNode()
						newNode.type = GSLINE
						newNode.position = ( node[0], node[1] )
						eraserRect.nodes.append( newNode )
					eraserRect.closed = True
					Erasers.append(eraserRect)
				PathOperator = GSPathOperator.alloc().init()
				Paths = givenLayer.pyobjc_instanceMethods.paths()
				PathOperator.subtractPaths_from_error_(Erasers, Paths, None)
				givenLayer.paths = Paths
		except Exception, e:
			Glyphs.showMacroWindow()
			print e % "Make Bubble Layers Error (fitToSidebearing): %s"
dataset/ETHPy150Open Tosche/BubbleKern/Make Bubble Layers.py/MakeBubbleLayers.fitToSidebearing/swapped operands of `%`