]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91212: Fixed flickering when the tracer is turned off (GH-95129)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 29 Sep 2022 07:09:16 +0000 (00:09 -0700)
committerGitHub <noreply@github.com>
Thu, 29 Sep 2022 07:09:16 +0000 (00:09 -0700)
Fixed flickering when the tracer is turned off.
(cherry picked from commit 4652093e1b816b78e9a585d671a807ce66427417)

Co-authored-by: Shin-myoung-serp <relent95@naver.com>
Lib/turtle.py
Lib/turtledemo/clock.py
Misc/NEWS.d/next/Library/2022-07-22-09-09-08.gh-issue-91212.53O8Ab.rst [new file with mode: 0644]

index f3b320b90caebc1e4ce6145f1155c15f757cec3a..11272835f914508392658bcae76e16ffc9aea8ea 100644 (file)
@@ -595,7 +595,6 @@ class TurtleScreenBase(object):
         item = self.cv.create_text(x-1, -y, text = txt, anchor = anchor[align],
                                         fill = pencolor, font = font)
         x0, y0, x1, y1 = self.cv.bbox(item)
-        self.cv.update()
         return item, x1-1
 
 ##    def _dot(self, pos, size, color):
@@ -3403,6 +3402,7 @@ class RawTurtle(TPen, TNavigator):
         """
         item, end = self.screen._write(self._position, txt, align, font,
                                                           self._pencolor)
+        self._update()
         self.items.append(item)
         if self.undobuffer:
             self.undobuffer.push(("wri", item))
index 62c8851606b34e3f0189e6c7a71912b7f1f65b44..9f8585bd11e053e3ce668c0a9feccc5f7db438e9 100755 (executable)
@@ -109,7 +109,6 @@ def tick():
         writer.write(datum(t),
                      align="center", font=("Courier", 14, "bold"))
         writer.forward(85)
-        tracer(True)
         second_hand.setheading(6*sekunde)  # or here
         minute_hand.setheading(6*minute)
         hour_hand.setheading(30*stunde)
diff --git a/Misc/NEWS.d/next/Library/2022-07-22-09-09-08.gh-issue-91212.53O8Ab.rst b/Misc/NEWS.d/next/Library/2022-07-22-09-09-08.gh-issue-91212.53O8Ab.rst
new file mode 100644 (file)
index 0000000..8552f51
--- /dev/null
@@ -0,0 +1 @@
+Fixed flickering of the turtle window when the tracer is turned off. Patch by Shin-myoung-serp.