diff --git a/appveyor.yml b/appveyor.yml index 21481951..c0464e36 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,9 +1,9 @@ environment: matrix: - - JULIAVERSION: "julialang/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe" - - JULIAVERSION: "julialang/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe" - - JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe" - - JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe" + - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe" + - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe" + - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe" + - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe" notifications: - provider: Email @@ -12,13 +12,14 @@ notifications: on_build_status_changed: false install: + - ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12" # If there's a newer build queued for the same PR, cancel this one - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` throw "There are newer queued builds for this pull request, failing early." } # Download most recent Julia Windows binary - - ps: (new-object net.webclient).DownloadFile($("http://s3.amazonaws.com/"+$env:JULIAVERSION), "C:\projects\julia-binary.exe") + - ps: (new-object net.webclient).DownloadFile($env:JULIA_URL, "C:\projects\julia-binary.exe") # Run installer silently, output to C:\projects\julia - C:\projects\julia-binary.exe /S /D=C:\projects\julia diff --git a/src/backends/gr.jl b/src/backends/gr.jl index d1060f84..60f2af78 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -277,10 +277,11 @@ function gr_draw_marker(xi, yi, msize, shape::Shape) sx, sy = coords(shape) # convert to ndc coords (percentages of window) GR.selntran(0) + w, h = gr_plot_size + f = msize / (w + h) xi, yi = GR.wctondc(xi, yi) - ms_ndc_x, ms_ndc_y = gr_pixels_to_ndc(msize, msize) - GR.fillarea(xi .+ sx .* ms_ndc_x, - yi .+ sy .* ms_ndc_y) + GR.fillarea(xi .+ sx .* f, + yi .+ sy .* f) GR.selntran(1) end @@ -442,15 +443,6 @@ end gr_view_xcenter() = 0.5 * (viewport_plotarea[1] + viewport_plotarea[2]) gr_view_ycenter() = 0.5 * (viewport_plotarea[3] + viewport_plotarea[4]) -gr_view_xdiff() = viewport_plotarea[2] - viewport_plotarea[1] -gr_view_ydiff() = viewport_plotarea[4] - viewport_plotarea[3] - -function gr_pixels_to_ndc(x_pixels, y_pixels) - w,h = gr_plot_size - totx = w * gr_view_xdiff() - toty = h * gr_view_ydiff() - x_pixels / totx, y_pixels / toty -end # -------------------------------------------------------------------------------------- @@ -512,6 +504,11 @@ function gr_display(plt::Plot) end +function _update_min_padding!(sp::Subplot{GRBackend}) + sp.minpad = (10mm,2mm,2mm,8mm) +end + + function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) # the viewports for this subplot viewport_subplot = gr_viewport_from_bbox(sp, bbox(sp), w, h, viewport_canvas) @@ -664,7 +661,9 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) # spine (border) and tick marks gr_set_line(1, :solid, sp[:xaxis][:foreground_color_axis]) + GR.setclip(0) gr_polyline(coords(spine_segs)...) + GR.setclip(1) if !(xticks in (nothing, false)) # x labels @@ -679,7 +678,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) # use xor ($) to get the right y coords xi, yi = GR.wctondc(cv, (flip $ mirror) ? ymax : ymin) # @show cv dv ymin xi yi flip mirror (flip $ mirror) - gr_text(xi, yi + (mirror ? 1 : -1) * 2e-3, string(dv)) + gr_text(xi, yi + (mirror ? 1 : -1) * 1e-2, string(dv)) end end @@ -696,22 +695,9 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) # use xor ($) to get the right y coords xi, yi = GR.wctondc((flip $ mirror) ? xmax : xmin, cv) # @show cv dv xmin xi yi - gr_text(xi + (mirror ? 1 : -1) * 2e-3, yi, string(dv)) + gr_text(xi + (mirror ? 1 : -1) * 1e-2, yi, string(dv)) end end - - # window_diag = sqrt(gr_view_xdiff()^2 + gr_view_ydiff()^2) - # ticksize = 0.0075 * window_diag - # if outside_ticks - # ticksize = -ticksize - # end - # # TODO: this should be done for each axis separately - # gr_set_linecolor(xaxis[:foreground_color_axis]) - - # x1, x2 = xaxis[:flip] ? (xmax,xmin) : (xmin,xmax) - # y1, y2 = yaxis[:flip] ? (ymax,ymin) : (ymin,ymax) - # GR.axes(xtick, ytick, x1, y1, 1, 1, ticksize) - # GR.axes(xtick, ytick, x2, y2, -1, -1, -ticksize) end # end