takluyver / mobilechelonian

Turtles on a notebook
Other
100 stars 37 forks source link

turtle strokeWidth seems too large #6

Closed FranciscoMoya closed 7 years ago

FranciscoMoya commented 8 years ago

mobilechelolianjs sets a default stroke width of 3 units. This is way larger than the default width in the stock Python turtle module.

Besides there is a typo in turtlewidget.js which fails to set the default strokeWidth because of wrong capitalization unless you invoke penup/pendown (I already submitted a pull request to fix this).

Since pensize is still missing I would suggest to reduce the default pen size to 1.

Regards,

takluyver commented 8 years ago

I'm not too worried about the drawings looking exactly the same as the stock turtle module, but if you want to change the default pen width, can you show screenshots of current vs proposed?

ghost commented 7 years ago

On this image (generated by the code below) the first line is thinner than the others, but in the code, strokeWidth has not been changed.

image

from mobilechelonian import Turtle
t = Turtle()
t.speed(5)

lineLength = 100
for k in range(4):
    t.left(90)
    t.forward(lineLength)
    t.penup()
    t.right(180)
    t.forward(lineLength)
    t.left(90)
    t.forward(25)
    t.pendown()
takluyver commented 7 years ago

Weird, not sure what's happening. I'm not likely to have time to dig into it soon, but if you can work out what's going on, PRs welcome.

ghost commented 7 years ago

Same code as above, but now with 0.4 release. All lines have now the same width.

from mobilechelonian import Turtle
t = Turtle()
t.speed(5)

lineLength = 100
for k in range(4):
    t.left(90)
    t.forward(lineLength)
    t.penup()
    t.right(180)
    t.forward(lineLength)
    t.left(90)
    t.forward(25)
    t.pendown()

image

takluyver commented 7 years ago

Aha, yes, @FranciscoMoya's PR #5 fixed that too.

I'm going to close this as I think the thicker default pen is OK, and while I want it to be API-compatible with the default turtle module, I don't think graphical similarity is that important. If anyone feels strongly that the default pen should be thinner, feel free to state your case :-)