It's been years since I've made an account anywhere to ask a questions I can normally, Google, but I'm genuinely a bit stuck and can't find the solution that seems like it should be staring me in the face.
The below code is in C# using the NuGet wrapper, though it probably doesn't matter. Long story short, I have an abstract "BaseSprite" class that's allowed to have its own children. It has a Draw function which takes a RenderTarget and a Transform. (its parent's global transform, of which the window passes in an Identity for the topmost children)
I then have a Sprite, a RenderState, and a local transform that's used in the RenderState instead of the sprite's transform (the sprite's transform isn't used at all. The local transform completely replaces it.)
The global transform is the parentTransform * localTransform, and the renderState uses the globalTransform.
I can move the sprite around, rotate it, scale it, etc just fine. The problem comes with origins and (at least rotation, but I suspect scale won't work either.)
If I translate the local transform anywhere on screen and set the origin anywhere, then rotate it, it rotates on the origin just fine. If I start translating the transform further, the rotation starts to become quite off, even if I move the origin point with the translation. I'm sure I'm missing something obvious, but I've tried everything I can for now and I really need some ideas to bounce off of.
Paste can be found here:
https://gist.github.com/egg82/8ce4235dabef9ca31b7d62a63b287e05. PrecisePoint and PreciseRectangle are just Point and Rectangle using doubles. BaseWindow is just the SFML Window, which is also the RenderTarget.
Edit
A video displaying the odd properties can be found here:
https://www.youtube.com/watch?v=Pc1YqDM1iC8&feature=youtu.be