shoes-deprecated icon indicating copy to clipboard operation
shoes-deprecated copied to clipboard

Circles are created with diameter instead of radius

Open wasnotrice opened this issue 12 years ago • 3 comments

The manual says that when you create a circle like this:

oval(100, 100, 200)

you should get a circle with top left (100, 100), and a radius of 200. You actually get a circle with diameter 200. Here's a demo app:

https://gist.github.com/2341166

Red Shoes:

Red Shoes

Purple Shoes:

Purple Shoes

wasnotrice avatar Apr 09 '12 03:04 wasnotrice

I'm not sure but it can be because of this line https://github.com/shoes/shoes/blob/develop/lib/shoes/chipmunk.rb#L18 I'll try to fix it tonight.

nashby avatar Apr 09 '12 05:04 nashby

Yeah, this is a bad spec, may be a bug of Red Shoes, IMHO. So, I decided to change the behavior in Green and Purple Shoes.

@nashby It's not because of chipmunk.rb. Look at this: https://github.com/shoes/shoes/blob/develop/shoes/canvas.c#L508 In Red Shoes, radius seems to be set to width.

ashbb avatar Apr 09 '12 12:04 ashbb

@ashbb I agree, this is a bug in red shoes. Green and Purple are correct. To not break current apps, it might be better to leave this behavior as is in Red for now, and fix it in a future release. But the manual is confusing.

wasnotrice avatar Apr 09 '12 13:04 wasnotrice