Skip to content

Commit

Permalink
convert to Int in setfield
Browse files Browse the repository at this point in the history
  • Loading branch information
aviks committed Jul 23, 2020
1 parent 88c0e30 commit 0325012
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/screen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Base.convert(T::Type{SDL2.Rect}, r::Rect) = SDL2.Rect(Cint.((r.x, r.y, r.w, r.h)

function Base.setproperty!(s::Geom, p::Symbol, x)
if hasfield(typeof(s), p)
setfield!(s, p, x)
setfield!(s, p, Int(round(x)))
else
v = getPos(Val(p), s, x)
setfield!(s, :x, Int(round(v[1])))
Expand Down

0 comments on commit 0325012

Please sign in to comment.