We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 03ccd3b + 3c05528 commit 0cc7be4Copy full SHA for 0cc7be4
src/projective/crop.jl
@@ -117,10 +117,11 @@ the crop by `offsets[i]` times the difference between the two.
117
function offsetcropbounds(
118
sz::NTuple{N, Int},
119
bounds::Bounds{N},
120
- offsets::NTuple{N, <:Number}) where N
+ offsets::NTuple{N, T}) where {N, T<:AbstractFloat}
121
+ offsets = map(o -> o == one(T) ? one(T) - eps(T) : o, offsets)
122
indices = bounds.rs
123
mins = getindex.(indices, 1)
- diffs = length.(indices) .- sz
124
+ diffs = length.(indices) .- sz .+ 1
125
126
startindices = floor.(Int, mins .+ (diffs .* offsets))
127
endindices = startindices .+ sz .- 1
0 commit comments