Skip to content

Commit

Permalink
Merge pull request #88 from knuesel/refactor-f0-rect
Browse files Browse the repository at this point in the history
Replace Point2f0 with Point2f, FRect2D with Rect2f, etc.
  • Loading branch information
SimonDanisch authored Aug 28, 2021
2 parents 7258a93 + ac27540 commit 952dc21
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
Colors = "0.12"
GeoInterface = "0.5"
GeoJSON = "0.5"
GeometryBasics = "0.2, 0.3"
GeometryBasics = "0.4.1"
ImageMagick = "1"
Makie = "0.13, 0.14, 0.15"
Makie = "0.15.2"
Reexport = "0.2, 1.0"
StructArrays = "0.4, 0.5, 0.6"
julia = "1"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ begin
field = [exp(cosd(l)) + 3(y/90) for l in lons, y in lats]
points = map(CartesianIndices(size(field))) do xy
x, y = Tuple(xy)
Point2f0(lons[x], lats[y])
Point2f(lons[x], lats[y])
end
limits = FRect2D(Makie.apply_transform(ptrans, points))
limits = Rect2f(Makie.apply_transform(ptrans, points))
limits!(ax, limits)
wireframe!(ax, lons, lats, field, color=(:gray, 0.2), transparency=true)

Expand Down
4 changes: 2 additions & 2 deletions examples/geomakie_new.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ begin
field = [exp(cosd(l)) + 3(y/90) for l in lons, y in lats]
points = map(CartesianIndices(size(field))) do xy
x, y = Tuple(xy)
Point2f0(lons[x], lats[y])
Point2f(lons[x], lats[y])
end
limits = FRect2D(Makie.apply_transform(ptrans, points))
limits = Rect2f(Makie.apply_transform(ptrans, points))
limits!(ax, limits)
wireframe!(ax, lons, lats, field, color=(:gray, 0.2), transparency=true)

Expand Down
8 changes: 4 additions & 4 deletions examples/meshgrid2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ geoaxis!(scene, -180, 180, -90, 90; crs = (src = src, dest = dest,));
visible = node(:visible, false)

poprect = lift(scene.events.mouseposition) do mp
FRect((mp .+ 5), 250, 40)
Rectf((mp .+ 5), 250, 40)
end
textpos = lift(scene.events.mouseposition) do mp
Vec3f0((mp .+ 5 .+ (250/2, 40 / 2))..., 120)
Vec3f((mp .+ 5 .+ (250/2, 40 / 2))..., 120)
end
popup = poly!(campixel(scene), poprect, raw = true, color = :white, strokewidth = 2,
strokecolor = :black, visible = visible)

rect = popup[end]

translate!(rect, Vec3f0(0, 0, 100))
translate!(rect, Vec3f(0, 0, 100))

textnode = Observable(" ")

Expand All @@ -47,7 +47,7 @@ text!(popup, textnode, textsize = 30, position = textpos, color = :darkred, alig
on(scene.events.mouseposition) do pos
if ispressed(scene, Mouse.left)
visible[] = true
pos = to_world(scene, Point2f0(scene.events.mouseposition[]))
pos = to_world(scene, Point2f(scene.events.mouseposition[]))
tpos = transform(dest, source, pos)
textnode[] = sprint(io-> print(io, round.(Float64.(tpos), digits = 3)))
else
Expand Down
2 changes: 1 addition & 1 deletion src/conversions.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# # Helper functions
to_point2(a::Vector{<: Number}) = Point2f0(a[1], a[2])
to_point2(a::Vector{<: Number}) = Point2f(a[1], a[2])

"""
GeoInterface -> GeometryBasics
Expand Down
4 changes: 2 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ using Proj4
field = [exp(cosd(l)) + 3(y/90) for l in lons, y in lats]
points = map(CartesianIndices(size(field))) do xy
x, y = Tuple(xy)
Point2f0(lons[x], lats[y])
Point2f(lons[x], lats[y])
end
limits = FRect2D(Makie.apply_transform(ptrans, points))
limits = Rect2f(Makie.apply_transform(ptrans, points))
limits!(ax, limits)
wireframe!(ax, lons, lats, field, color=(:gray, 0.2), transparency=true)

Expand Down

0 comments on commit 952dc21

Please sign in to comment.