def DrawOutline(self, margin = 0): if self.outline: outline = self.outline else: outline = VectorLineTrace(parent=self, lineWidth=1, idx=0) outline.isLoop = True self.outline = outline outline.Flush() self.cornerPoints = [] colors = [(1, 0, 0, 1), (1, 1, 1, 1), (0, 1, 0, 1), (1, 1, 1, 1), (0, 0, 1, 1), (1, 1, 1, 1)] for i in xrange(6): if self.isFlatTop: outlineRad = self.displayWidth * 0.5 - margin angle = 2.0 * math.pi / 6.0 * i else: outlineRad = self.displayHeight * 0.5 - margin angle = 2.0 * math.pi / 6.0 * (i + 0.5) x_i = ReverseScaleDpi(self.displayWidth * 0.5 + outlineRad * math.cos(angle)) y_i = ReverseScaleDpi(self.displayHeight * 0.5 + outlineRad * math.sin(angle)) outline.AddPoint((x_i, y_i), colors[i]) self.cornerPoints.append((x_i, y_i))
def DrawOutline(self, margin = 0): if self.outline: outline = self.outline else: outline = VectorLineTrace(parent=self, lineWidth=1, idx=0) outline.isLoop = True self.outline = outline outline.Flush() self.cornerPoints = [] colors = [(1, 0, 0, 1), (1, 1, 1, 1), (0, 1, 0, 1), (1, 1, 1, 1), (0, 0, 1, 1), (1, 1, 1, 1)] for i in xrange(6): if self.isFlatTop: outlineRad = self.displayWidth * 0.5 - margin angle = 2.0 * math.pi / 6.0 * i else: outlineRad = self.displayHeight * 0.5 - margin angle = 2.0 * math.pi / 6.0 * (i + 0.5) x_i = ReverseScaleDpi(self.displayWidth * 0.5 + outlineRad * math.cos(angle)) y_i = ReverseScaleDpi(self.displayHeight * 0.5 + outlineRad * math.sin(angle)) outline.AddPoint((x_i, y_i), colors[i]) self.cornerPoints.append((x_i, y_i))
def DrawOutline(self): if self.outline: outline = self.outline else: outline = VectorLineTrace(parent=self, lineWidth=2) outline.isLoop = True self.outline = outline outline.Flush() for i in xrange(6): if self.isFlatTop: outlineRad = self.displayWidth * 0.5 angle = 2.0 * math.pi / 6.0 * i else: outlineRad = self.displayHeight * 0.5 angle = 2.0 * math.pi / 6.0 * (i + 0.5) x_i = ReverseScaleDpi(self.displayWidth * 0.5 + outlineRad * math.cos(angle)) y_i = ReverseScaleDpi(self.displayHeight * 0.5 + outlineRad * math.sin(angle)) outline.AddPoint((x_i, y_i), (1, 0, 0, 0.8))
def DrawOutline(self): if self.outline: outline = self.outline else: outline = VectorLineTrace(parent=self, lineWidth=2) outline.isLoop = True self.outline = outline outline.Flush() for i in xrange(6): if self.isFlatTop: outlineRad = self.displayWidth * 0.5 angle = 2.0 * math.pi / 6.0 * i else: outlineRad = self.displayHeight * 0.5 angle = 2.0 * math.pi / 6.0 * (i + 0.5) x_i = ReverseScaleDpi(self.displayWidth * 0.5 + outlineRad * math.cos(angle)) y_i = ReverseScaleDpi(self.displayHeight * 0.5 + outlineRad * math.sin(angle)) outline.AddPoint((x_i, y_i), (1, 0, 0, 0.8))