Skip to content

Commit 3c05528

Browse files
authored
Round random offset to below 1.
1 parent 8d625a3 commit 3c05528

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/projective/crop.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ the crop by `offsets[i]` times the difference between the two.
117117
function offsetcropbounds(
118118
sz::NTuple{N, Int},
119119
bounds::Bounds{N},
120-
offsets::NTuple{N, <:Number}) where N
120+
offsets::NTuple{N, T}) where {N, T<:AbstractFloat}
121+
offsets = map(o -> o == one(T) ? one(T) - eps(T) : o, offsets)
121122
indices = bounds.rs
122123
mins = getindex.(indices, 1)
123124
diffs = length.(indices) .- sz .+ 1

0 commit comments

Comments
 (0)