Error in Graphics Tutorial

Hello,

There appears to be an error on this page:

https://docs.juce.com/master/tutorial_graphics_class.html

Near the middle bottom of the page we find these lines:

Rectangle house (300, 120, 200, 170);
g.fillCheckerBoard (house, 30, 10, Colours::sandybrown, Colours::saddlebrown);

However, the API for fillCheckerBoard found here:

https://docs.juce.com/master/classGraphics.html#af5cf5f78e8acc01c30f9f181eedacf2c

Lists fillCheckerBoard as taking a Rectangle <Float>, I can verify that my code would not run using Rectangle<Int>. So I’m not 100% if the bug is with the example or API, but there is a discrepancy.

Thanks
Alessandro

fillCheckerBoard() requires that the Rectangle be a float. Try changing Rectangle house (300, 120, 200, 170); to Rectangle<float> house (300, 120, 200, 170);

edit: didn’t notice this was under the site feedback section

Yes, thank you.

While I appreciate the feed back, this is posted in the Site Feedback section and is meant to clarify to the dev team the discrepancy in API vs Tutorial.

Thanks

Thanks for spotting that error. I’ll fix that right away.

1 Like