Commit e40c8ff7 authored by Romain Casati's avatar Romain Casati
Browse files

Upstream fix for turtle.dot.

parent 01aedc4d
......@@ -218,9 +218,12 @@ class Screen(metaclass=Singleton):
size = 1
self.frame_index += 1
# `size` represents the diameter, svg needs the radius
radius = size / 2
x, y = self._convert_coordinates(pos[0], pos[1])
circle = svg.circle(cx=x, cy=y, r=size, fill=color,
circle = svg.circle(cx=x, cy=y, r=radius, fill=color,
style={'display': 'none'})
an = svg.animate(Id=self.animation_frame_id(self.frame_index),
attributeName="display", attributeType="CSS",
......@@ -1232,6 +1235,10 @@ class Turtle(TPen, TNavigator):
def dot(self, size=None, color=None):
"""Draw a filled circle with diameter size, using color.
"""
if size is None:
size = max(self._pensize + 4, 2 * self._pensize)
if color is None:
color = self._pencolor
item = self.screen._dot((self._x, self._y), size, color=color)
def _write(self, txt, align, font, color=None):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment