How to get correct zooming in GUI.DrawTexture?

Hi!
I’m trying to zoom a texture in the Editor GUI according to the position of the mouse when you “scroll” down or up with the mouse wheal.
However I get a strange ofset which makes the texture float of when you scroll.
Here is a demo code:

Thanks for the help. I have worked on the problem for about 6 hours now.

Line 96 and 97 should be:

textureDisplayOfset.x = textureDisplayOfset.x - (scaleFactor-1)mouseTexturePos.xtextureDisplayScale;
textureDisplayOfset.y = textureDisplayOfset.y - (scaleFactor-1)mouseTexturePos.ytextureDisplayScale;

I did miss the scale factor.