Credit…Doug Mills/The New York Times

After mocking people for wearing masks, refusing to publicly wear one himself and holding rallies and gatherings where social distancing was not required, President Trump has shifted his tone.

He has canceled his convention activities in Jacksonville, Fla., after moving the events from North Carolina when that state’s governor raised public health concerns about such a large indoor gathering.

He has resumed briefings, ostensibly about the coronavirus, after canceling them and trying to move on to other matters, as if the virus would simply vanish if he sufficiently ignored it.

Trump is in real trouble. With the election passing the 100-day-away milestone, he is down in the polls, people don’t trust or approve of his handling of the pandemic and he faces a real uphill battle to re-election.

Apparently, the reality of his dire straits has begun to pierce his inner circle of perpetual affirmation. There is a reality lurking that can’t be lied away. If the election were held today, he wouldn’t win.

But Trump is a political chameleon: He can alter himself to suit his environment, to reflect it. He may not be fond of apologies, but he is open to course reversal, for survival.

Indeed, that is the maleficent marvel of it all: He has changed his position to the opposite of what it once was and argued that the new direction is the one he’s always embraced. Only a person with an utter contempt for the truth could repeatedly take this tact.

We need look no further than 2016 to see how Trump operates when he is desperate and in trouble, trying to woo the votes he needs, and how hollow and nakedly political his efforts can be.

In 2016, after calling Mexican immigrants drug dealers and rapists and promising to build a wall between the United States and Mexico — one that he would somehow force the Mexican government to finance — he posed with taco bowls on Cinco De Mayo and wrote on Twitter: “I love Hispanics!”