Gerrymandering has been a huge problem for a while, what makes you think this time it played a pivotal role in Trump's victory? If that was the case, he would have won the electoral vote but not the popular vote, but he won the popular vote, first Rep pres to do so in 20 years apparently. It helped secure past Rep presidencies, but doesn't to have done so this time around.
The number of electors to the electoral college are chosen by the number of congressional districts and 1 for each state senator in a state regardless of how those maps are drawn.
Texas has 38 congressional districts and 2 senators from the state, so they have 40 electors to the electoral college. That number does not change regardless how the maps are drawn. Same for every other state in the country.