ThickCircle does not work

6 views
Skip to first unread message

Adrian Sieber

unread,
Jul 16, 2018, 8:05:37 AM7/16/18
to Haskell Gloss
I have following working function:

drawCorner (x, y) =
  Translate x y (color red $ ThickCircle 2 10)


But no matter what values I set for ThickCircle, I always get a solid circle.
Is gloss broken, or am I doing something wrong?

Ben Lippmeier

unread,
Jul 16, 2018, 8:08:10 AM7/16/18
to haskel...@googlegroups.com
First value is radius, second is thickness. If the thickness is more than the radius it’ll just look like a filled circle.

Try the gloss-lifespan example, which uses thick circles. It should look something like the attached picture.

Ben.



Adrian Sieber

unread,
Jul 17, 2018, 2:49:25 AM7/17/18
to haskel...@googlegroups.com
> First value is radius, second is thickness. If the thickness is more
> than the radius it’ll just look like a filled circle.
What the heck. The documentation always talks about "thickness and
radius" (e.g.
http://hackage.haskell.org/package/gloss-1.12.0.0/docs/Graphics-Gloss-Data-Picture.html).
Also, it makes much more sense to curry it with the thickness (e.g.
`mediumThickCircle = ThickCircle 5).
You much rather want several circles with different radiuses but the
same thickness, than circles with the same radius, but different
thicknesses.

This is so unintuitive, I'd call it a bug and reverse the order in the
next version ^^.

Ben Lippmeier

unread,
Jul 17, 2018, 4:18:10 AM7/17/18
to haskel...@googlegroups.com, Adrian Sieber


> On 17 Jul 2018, at 4:49 pm, Adrian Sieber <adrian....@gmail.com> wrote:
>
>> First value is radius, second is thickness. If the thickness is more than the radius it’ll just look like a filled circle.

> What the heck. The documentation always talks about "thickness and radius" (e.g. http://hackage.haskell.org/package/gloss-1.12.0.0/docs/Graphics-Gloss-Data-Picture.html).
> Also, it makes much more sense to curry it with the thickness (e.g. `mediumThickCircle = ThickCircle 5).
> You much rather want several circles with different radiuses but the same thickness, than circles with the same radius, but different thicknesses.

Err, good point. The docs are wrong, which is very confusing.

> This is so unintuitive, I'd call it a bug and reverse the order in the next version ^^.


I’ll update the docs. I think that swapping the order of arguments of the same type risks silently breaking existing user code.

Ben.




Reply all
Reply to author
Forward
0 new messages