These are chat archives for jheinen/GR.jl

6th
Jul 2016
Josef Heinen
@jheinen
Jul 06 2016 14:05
@tmptrash , please check jheinen/gr@7a74e52 . The workaround seems to solve the (re-)size problem ...
A GR.jl rebuild should solve your problem.
DeadbraiN
@tmptrash
Jul 06 2016 14:58
Thanks!
And what about this jheinen/GR.jl#26 issue? Is it okay to use these coofficients?
Josef Heinen
@jheinen
Jul 06 2016 16:11
@tmptrash Yes!
DeadbraiN
@tmptrash
Jul 06 2016 16:48
Great! I will check it :)
Josef Heinen
@jheinen
Jul 06 2016 16:57
@tmptrash , That's how I tested:
using GR

mwidth, mheight, width, height = GR.inqdspsize()
w = 400
h = 300
if w >= h
    ratio = float(h) / w
    msize = mwidth * w / width
    GR.setwsviewport(0, msize, 0, msize * ratio)
    GR.setwswindow(0, 1, 0, ratio)
else
    ratio = float(w) / h
    msize = mheight * h / height
    GR.setwsviewport(0, msize * ratio, 0, msize)
    GR.setwswindow(0, ratio, 0, 1)
end

setviewport(0, 1, 0, ratio)
setwindow(1, w, 1, h)

drawrect(1, w, 1, h)
polyline([1,w],[1,h])
polyline([1,w],[h,1])
Josef Heinen
@jheinen
Jul 06 2016 18:41
To use continuous inline displays with the latest (stable) iTerm2 application you will have to checkout the GR.jl master branch (jheinen/GR.jl@505f610), e.g.
using GR
inline("iterm", false)

x = collect(0:0.01:2*pi)
for i = 1:200
    plot(x, sin(x + i / 10.0))
end
Josef Heinen
@jheinen
Jul 06 2016 19:05
@tmptrash , or make the stress test:
using GR

mwidth, mheight, width, height = GR.inqdspsize()

while true
    clearws()

    w = 400 + round(Int, rand() * 200)
    h = 400 + round(Int, rand() * 200)
    if w >= h
        ratio = float(h) / w
        msize = mwidth * w / width
        GR.setwsviewport(0, msize, 0, msize * ratio)
        GR.setwswindow(0, 1, 0, ratio)
        setviewport(0, 1, 0, ratio)
    else
        ratio = float(w) / h
        msize = mheight * h / height
        GR.setwsviewport(0, msize * ratio, 0, msize)
        GR.setwswindow(0, ratio, 0, 1)
        setviewport(0, ratio, 0, 1)
    end

    setwindow(1, w, 1, h)

    drawrect(1, w, 1, h)
    polyline([1,w],[1,h])
    polyline([1,w],[h,1])
    text(0.05, 0.05, "$w x $h")

    updatews()
DeadbraiN
@tmptrash
Jul 06 2016 20:45
Thanks