Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #460 from JuliaGraphics/teh/coords
Browse files Browse the repository at this point in the history
Support Graphics 1.0 and test set_coordinates (+Documenter bounds)
  • Loading branch information
timholy authored Dec 8, 2019
2 parents 0f8cd4f + be03ff3 commit 8259da0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
6 changes: 2 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,19 @@ gdk_pixbuf_jll = "da03df04-f53b-5353-a52f-6a8b0620ced0"
hicolor_icon_theme_jll = "059c91fe-1bad-52ad-bddd-f7b78713c282"

[compat]
julia = "1.3"
Cairo = "1.0.0"
Cairo_jll = "1.16.0"
GTK3_jll = "3.24.11"
Glib_jll = "2.59.0"
Graphics = "0.4.0"
Graphics = "0.4, 1"
Reexport = "0.2"
adwaita_icon_theme_jll = "3.33.92"
gdk_pixbuf_jll = "2.38.2"
hicolor_icon_theme_jll = "0.17.0"
julia = "1.3"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]


3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Documenter = "v0.24"
20 changes: 19 additions & 1 deletion test/gui.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ wdth, hght = screen_size()
if !Sys.iswindows()
@test wdth > 0 && hght > 0
end

@testset "Window" begin
w = Window("Window", 400, 300) |> showall
if !Sys.iswindows()
Expand Down Expand Up @@ -532,6 +532,24 @@ draw(c)
destroy(w)
end

@testset "SetCoordinates" begin
win = Window() |> (cnvs = Canvas(300, 280))
draw(cnvs) do c
set_coordinates(getgc(c), BoundingBox(0, 1, 0, 1))
end
Gtk.showall(win)
sleep(0.5)
mtrx = Gtk.Cairo.get_matrix(getgc(cnvs))
if get(ENV, "CI", nothing) === nothing || !Sys.islinux()
@test mtrx.xx == 300
@test mtrx.yy == 280
else
@test_broken mtrx.xx == 300
@test_broken mtrx.yy == 280
end
@test mtrx.xy == mtrx.yx == mtrx.x0 == mtrx.y0 == 0
end

@testset "Menus" begin
file = MenuItem("_File")
filemenu = Menu(file)
Expand Down

0 comments on commit 8259da0

Please sign in to comment.