Checking whether two strokes overlap
The code in the if is duplicate, so we can extract it to a method that I will call gte (greater than or equal). The maxs and mins values ​​are used at this comparison, so they will be moved to the new method too:

def gte(bounds1, bounds2)
    min_x, max_x, min_y, max_y = 0, 1, 2, 3

    bounds1[max_x] &gt;= bounds2[min_x] &amp;&amp; bounds1[max_y] &gt;= bounds2[min_y]
end


The content in the if expression changes to:

gte(bounds1, bounds2) &amp;&amp; gte(bounds2, bounds1)


But the if is not necessary because this expression already returns a boolean value, then we will return it directly. The keyword return is not required, then the method overlap? code looks like this:

def overlap?(stroke1, stroke2)
    bounds1 = get_bounds stroke1
    bounds2 = get_bounds stroke2

    gte(bounds1, bounds2) &amp;&amp; gte(bounds2, bounds1)
end


Maybe you have a better name than gte, but remember that it must have a meaningful name!