We are looking for the probability of the sum of two random numbers being less than or equal to K, the two random numbers, $r_1$ and $r_2$, are constrained as followed:
$0 \leq r_1 \leq m_1 $
$ 0 \leq r_2 \leq m_2$
Let's say that: $$ m_1=6, m_2=6, K=2$$
Let's visualize it:

This is a "sum box". The sides are not discrete but continuous. Inside the box, we have indefintely many numbers summarized by adding up the number from $[0, m_1]$ and the number from $[0, m_2]$. Basically this shows all the possible combinations that you are able to create.
The area of possible outcomes is: $$m_1 \cdot m_2=6\cdot6=36$$
The area of possible outcomes of which $m_1+m_2<=K$ (the area of the green triangle) is: $$(K \cdot K)/2 = (22)/2=2 $$
We can now calculate the probability of the sum of the two numbers each with their own constrained interval as follows: (area of green triangle)/(area of grey square) = $2/36$
We can now conclude that the probability of the sum of two numbers chosen randomly from the interval $[0,6]$ the probability of the sum being less than or equal to 2 is $2/36$