Stretch/Shrink Ortho

I am trying to draw an object and based on the user’s movement of the mouse when holding down the right mouse button, I want to stretch or shrink the object. To do this I want to recalculate the min and max ortho values, instead of using the scale functionality. I need to know my min and max ortho values for other operations that this program will do. If the user moves the mouse left I want to horizontally shrink the object therefore resulting in increasing the ortho and if the mouse moves right stretch the object. Also if the mouse moves down I want to vertically shrink it and if it moves up vertically stretch the object. The more the mouse moves the more I want to stretch or shrink the object so that if the mouse moves the entire width or length of the screen, I want to double or halve the respective X or Y ortho widths. Does anyone have any idea on how I should approach this. I have tried so many different ideas and none of them are working. I am guessing I will need to do different calculations so when the MaxX is < 0, MinX > 0, MaxX == 0, and MinX == 0 and the same with the MinY and MaxY values. Thanks for all your help!

to keep track of the current ortho max and min values I suggest creating global variables and use them. To calculate that with the mouse just record where the mouse position is when the right mouse button is pressed and then where it currently is and just take the difference to decide how to change your ortho values