Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gfx.WholeArea -> image.Rect(0, 0, 0, 0) #88

Closed
azul3d-bot opened this issue Mar 6, 2016 · 2 comments
Closed

Add gfx.WholeArea -> image.Rect(0, 0, 0, 0) #88

azul3d-bot opened this issue Mar 6, 2016 · 2 comments

Comments

@azul3d-bot
Copy link

Issue by slimsag
Tuesday Oct 14, 2014 at 23:01 GMT
Originally opened as azul3d-legacy/gfx#15


All inputs in the gfx package that take image.Rectangles accept empty rectangles to mean the entire area, which is often quite useful. The downside is that it causes a lot of typing which isn't obvious to someone who hasn't read the docs:

r.Clear(image.Rect(0, 0, 0, 0), gfx.Color{1, 1, 1, 1})

If we exposed a variable in the gfx package named e.g. WholeArea, like so:

var WholeArea = image.Rect(0, 0, 0, 0)

Then the above code would simply become:

r.Clear(gfx.WholeArea, gfx.Color{1, 1, 1, 1})

Which I believe to be more easy for newcomers.

@azul3d-bot
Copy link
Author

Comment by slimsag
Tuesday Nov 04, 2014 at 18:20 GMT


With version two we have the ability to re-think things like this. The image package has any rectangle such as image.Rect(0, 0, 0, 0) considered an empty rectangle.

I am wondering if what we originally did (allowing a empty rectangle to be considered the entire area) was wrong.

What I think we should do is:

  • Make it so that any Clear operation on a Canvas with a empty rectangle argument is no-op.
  • Recommend the use of Renderer.Bounds() instead of an empty rectangle in order to specify the whole area.

@dskinner what do you think of this?

@slimsag
Copy link
Member

slimsag commented Mar 6, 2016

Fixed/merged as part of #1

@slimsag slimsag closed this as completed Mar 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants