1. Anders Ruud
  2. love
  3. Issues


Issue #669 wontfix

Changing setLineStyle to accept a boolean

created an issue

I think it might be neat if love.graphics.setLineStyle accepted a boolean for "are lines smooth or not" and is renamed appropriately.

I think it could be easier to understand, and simpler, without the enum.

For example, if you saw:


You might think "This sets the line style to smooth. What else could the line style be?"

But if you saw:


You'd hopefully think "This makes lines smooth, and if I put false instead of true, they'd be unsmooth".

And also, I guess it depends how you think about it, but I think this state has a boolean nature: lines can be smoothed or not, just like a Source can be looping or not or the display can be fullscreen or not.

And you can do stuff like this! :P

love.graphics.setLineSmoothing(not love.graphics.getLineSmoothing())

This breaks consistency with setPointStyle, which also takes an enum which is either "smooth" or "rough", however,

  1. I think points should maybe be removed anyway. :P #631
  2. I don't think the enum for setPointStyle is very descriptive. Perhaps it could be "circle" and "square" instead?
  3. The point style doesn't really have a boolean nature like line smoothing does. It's not really like the styles are circles and "non-circles".

Comments (2)

  1. Alex Szpakowski

    setLineStyle might be extended in the future to change the line caps as well (see issue #659).

    I think it's better to keep this function open to that kind of change rather than forcing entirely new functions for other line style settings.

  2. Log in to comment