GUIStyle Affecting GUIRect - Which part?

I’m drawing a button with GUI.Button and a custom GUI style, but I’m also making the game resolution and aspect-ratio independent so the GUIRect varies considerably in both scale and aspect. If I use the same texture and rect with GUI.DrawTexture the shape is drawn correctly, but with GUI.Button the button is drawn the wrong shape.

Now there are quite a lot of options with GUIStyles but I’ve been through all the ones that seem vaguely relevant and none of them seem to stop Unity from ignoring my Rect.

My Padding, Border, Margin and Overflow are all zero, so it’s not them. Stretch Width and Stretch Height are both disabled, so that Unity does not stretch horizontally or vertically “for a better layout”. Additionally, fixed width and fixed height are both set to zero to stop Unity from trying to “override any provided Rect() value” but still it is not using the Rect properly.

So essentially, this draws correctly:

//GUI.DrawTexture(TrinityDialExamineDrawRect, TrinityDialExamineTexture);

And this draws incorrectly:

GUI.Button(TrinityDialExamineDrawRect, TrinityDialExamineTexture, TrinityButtonStyle)

It’s almost as though Unity is refusing to use the full width of the rect available to it, to draw my image, but with zero set for border, padding, margin and overflow, I can’t imagine why that would be.

EDIT: Sorry, I missed one. Content offset is set to zero as well.

How are you achieving the resolution independence? Are you altering the values of the GUI matrix, positioning by screen width/height fractions… ?

I’m using the GUI.Matrix to simulate a virtual resolution of 1920x1080 and then just using a few utility functions to resize the drawing rects of things which need to maintain an aspect ratio and things which are mouse relative. For example, the mouse cursor should be perfectly square and needs to be positioned at the actual mouse coordinates so I need to convert from screen coordinates to virtual coordinates in order to position it correctly and adapt the width and height to keep it square. (It needs to be drawn rectangular to appear square if the screen has a non 16:9 aspect ratio, if that makes sense.)

Any chance you can post the whole script (or the button styles and matrix parts at least)?