s1ddok/Alloy

extension MTLRegion has wrong (+1) maxX maxY maxZ

atrbx5 opened this issue · 3 comments

if my texture has size of 5
then my minX is 0
and my maxX is 4
with current implementation it's 5

public extension MTLRegion {
    var maxX: Int {
        return self.origin.x + self.size.width
    }    
    var maxY: Int {
        return self.origin.y + self.size.height
    }    
    var maxZ: Int {
        return self.origin.z + self.size.depth
    }

hmmm, yes, this seems wrong. I will try to address this asap, would you love to hit a PR maybe?

took me a while but I finally fixed it lol

took me a while but I finally fixed it lol

oh yeah... Feb 2022 I was a bit distracted from making PR ;) sorry