mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-04 19:10:09 +01:00
Some Py3 fixes for roses sample
This commit is contained in:
@@ -107,7 +107,7 @@ class rose:
|
|||||||
if stop >= self.endpt:
|
if stop >= self.endpt:
|
||||||
stop = self.endpt
|
stop = self.endpt
|
||||||
keep_running = False
|
keep_running = False
|
||||||
for i in range (self.nextpt, stop + 1):
|
for i in range (self.nextpt, int(stop + 1)):
|
||||||
theta = (self.style * i) % self.nvec
|
theta = (self.style * i) % self.nvec
|
||||||
r = self.cos_table[(self.petals * theta) % self.nvec]
|
r = self.cos_table[(self.petals * theta) % self.nvec]
|
||||||
line.append((r * self.cos_table[theta], r * self.sin_table[theta]))
|
line.append((r * self.cos_table[theta], r * self.sin_table[theta]))
|
||||||
@@ -159,7 +159,7 @@ class rose:
|
|||||||
|
|
||||||
new_state = self.INT_DRAW
|
new_state = self.INT_DRAW
|
||||||
self.takesvec = self.nvec / self.gcd(self.nvec, self.style)
|
self.takesvec = self.nvec / self.gcd(self.nvec, self.style)
|
||||||
if not self.takesvec & 1 and self.petals & 1:
|
if not int(self.takesvec) & 1 and int(self.petals) & 1:
|
||||||
self.takesvec /= 2
|
self.takesvec /= 2
|
||||||
if self.cmd_state == self.CMD_GO:
|
if self.cmd_state == self.CMD_GO:
|
||||||
if self.minvec > self.takesvec or self.maxvec < self.takesvec:
|
if self.minvec > self.takesvec or self.maxvec < self.takesvec:
|
||||||
|
|||||||
@@ -453,7 +453,7 @@ class MyFrame(wx.Frame, clroses.rose):
|
|||||||
# Command buttons change their names based on the whether we're in auto
|
# Command buttons change their names based on the whether we're in auto
|
||||||
# or manual mode.
|
# or manual mode.
|
||||||
def AppCmdLabels(self, labels):
|
def AppCmdLabels(self, labels):
|
||||||
for name, label in map(None, ('Go', 'Redraw', 'Backward', 'Forward'), labels):
|
for name, label in zip(('Go', 'Redraw', 'Backward', 'Forward'), labels):
|
||||||
ctrl_buttons[name].SetLabel(label)
|
ctrl_buttons[name].SetLabel(label)
|
||||||
ctrl_buttons[name].SetForegroundColour(self.labelColours[label])
|
ctrl_buttons[name].SetForegroundColour(self.labelColours[label])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user