WorldPositionOffset Shifts Center in XY

Ok i found something to work with, but i still have this shifting issue. The quad should be perfectly centered but it isn’t.

I marked the Center Lines with yellow. As you can see they don’t go through the Center…

I use this CustomNode Code:

float4 NewPos = float4(InPosition.xyz, 1.f);
float4x4 TransformMat1 = {
	/*M[0][0]*/ InScale.x,	/*M[1][0]*/ 0.f,			/*M[2][0]*/  0.f,		 InOffset.x,
	/*M[0][1]*/ 0.f,		/*M[1][1]*/ InScale.y,		/*M[2][1]*/  0.f,		 InOffset.y,
	/*M[0][2]*/ 0.f,		/*M[1][2]*/ 0.f,			/*M[2][2]*/  1.f,	 	 InOffset.z,
				0.0f,					0.0f,						 0.0f,		 1.0f
};

float4x4 TransformMat2 = {
	/*M[0][0]*/ 1.f,		/*M[1][0]*/ 0.f,			/*M[2][0]*/  0.f,		 InOffset.x,
	/*M[0][1]*/ 0.f,		/*M[1][1]*/ 1.f,			/*M[2][1]*/  0.f,		 InOffset.y,
	/*M[0][2]*/ 0.f,		/*M[1][2]*/ 0.f,			/*M[2][2]*/  1.f,	 	 InOffset.z,
				0.0f,					0.0f,						 0.0f,		 1.0f
};

NewPos = mul(TransformMat2, NewPos);
NewPos = mul(TransformMat1, NewPos);

return NewPos;

And here the Material:

Note that the 2 last inputs are not used by the CustomNode at the Moment!

Solved it!

float4 NewPos = float4(InPosition.xyz, 1.f);
float4 NewPosTmp = NewPos;
float3 NewScale = (InScale * In2Scale);
float3 NewOffset = (InOffset);
float4x4 TransformMat1 = {
	/*M[0][0]*/ NewScale.x,	/*M[1][0]*/ 0.f,			/*M[2][0]*/  0.f,		 0.f,
	/*M[0][1]*/ 0.f,		/*M[1][1]*/ NewScale.y,		/*M[2][1]*/  0.f,		 0.f,
	/*M[0][2]*/ 0.f,		/*M[1][2]*/ 0.f,			/*M[2][2]*/  1.f,	 	 0.f,
				0.0f,					0.0f,						 0.0f,		 1.0f
};

float4x4 TransformMat2 = {
	/*M[0][0]*/ 1.f,		/*M[1][0]*/ 0.f,			/*M[2][0]*/  0.f,		 NewOffset.x,
	/*M[0][1]*/ 0.f,		/*M[1][1]*/ 1.f,			/*M[2][1]*/  0.f,		 NewOffset.y,
	/*M[0][2]*/ 0.f,		/*M[1][2]*/ 0.f,			/*M[2][2]*/  1.f,	 	 NewOffset.z,
				0.0f,					0.0f,						 0.0f,		 1.0f
};

NewPos = mul(TransformMat2, NewPos);
NewPos = mul(TransformMat1, NewPos);

float4x4 TransformMat4 = {
	/*M[0][0]*/ 1.f,		/*M[1][0]*/ 0.f,			/*M[2][0]*/  0.f,		 In2Offset.x,
	/*M[0][1]*/ 0.f,		/*M[1][1]*/ 1.f,			/*M[2][1]*/  0.f,		 In2Offset.y,
	/*M[0][2]*/ 0.f,		/*M[1][2]*/ 0.f,			/*M[2][2]*/  1.f,	 	 In2Offset.z,
				0.0f,					0.0f,						 0.0f,		 1.0f
};

NewPos = mul(TransformMat4, NewPos);

additional i need to subtract the LocalPosition before i pass it into the WorldPositionOffset