why this does not work?

here is the piece of code, basically it says that if the mouse is over on of two rectangles do not calculate distance based on mouse wheel...so mouse wheel should not work while the mouse is over any of these rectangles. it works if i try with each one but when i am checking both it does not work. i guess that my logic is wrong please help

if(!(rectPrimary.Contains(invertedMousePosition)) || !(rectSecundary.Contains(invertedMousePosition))){ 
        //CALCULATE DISTANCE BASED ON THE MOUSE WHEEL SCROLL
        distance += Input.GetAxis("Mouse ScrollWheel")*distance;
}

It should be && not ||

Alternative using || would be:

if(!(rectPrimary.Contains(invertedMousePosition) || rectSecundary.Contains(invertedMousePosition))) { 

Change your OR to an AND:

if(!rectA.Contains(foo) && !rectB.Contains(foo))
    doSomethingThatCannotBeDoneWhenFooInsideEitherRectOrBoth();

Or change your logical comparison to negate both:

if(!(rectA.Contains(foo) || rectB.Contains(foo)))
    doSomethingThatCannotBeDoneWhenFooInsideEitherRectOrBoth();

See DeMorgan's Law.

Well, assuming that your rectangles are not on top of each other, there is always a rectangle that is not under the mouse pointer, basically returning always `true`.