smooth / noSmooth - current state?

Hi, does it exist a way to know If line drawinf is currently set to smooth or noSmooth, like for stroke, strokeWidth, fill ecc. ?

I think you would have to keep track of it. How about:


local isSmooth = false
local oldsmooth = smooth
smooth = function ()
    isSmooth = true
    oldsmooth()
end
local oldNoSmooth = noSmooth
noSmooth = function ()
    isSmooth = false
    oldNoSmooth()
end
smoothing = function ()
    return isSmooth
end

Thanks @mpilgrem, what I meant was a predefined way, a flag or a function provided by codea, but that’s sure a good way to track it.

Thinking about it further, you would also have to overwrite pushStyle() and popStyle() to implement an additional stack to keep track of isSmooth values and overwrite resetStyle() to reset isSmooth accordingly.

Just added this as an issue as I’d quite like to be able to do this:

https://bitbucket.org/TwoLivesLeft/codea/issue/197/add-the-ability-to-read-off-the-entire