Adding dirty check in matrix concatenation loop for getTargetTransformationMatrix()