On Wednesday, the Supreme Court will hear arguments in a potentially historic gerrymandering case, and if you've been following redistricting news at all, you might think Republican line-drawing  is on trial.

From North Carolina to Wisconsin to Pennsylvania, Republicans have taken a beating in the courts recently for drawing congressional and state legislative districts that the courts found unfairly grouped one race or one party's voters into districts. The ensuing court decisions have mostly benefited Democrats, extremely helpful for that party as it tries to take back the House of Representatives this November.

But on Wednesday, Democrats' overt line-drawing is on trial, in a way that could reshape how both parties draw maps after the 2020 census. As The Washington Post's Robert Barnes explains, former Democratic Maryland governor Martin O'Malley said that Democrats there drew lines to elevate their congressional majority from 6 out of 8 seats to 7 out of 8. “Yes, this was clearly my intent,” O'Malley said in a deposition last spring.

That's just the way things have worked for decades. But the Supreme Court appears to be seriously considering declaring overt partisan gerrymandering, such as what happened in Maryland, unconstitutional for the first time.

The court has long been open to the idea that partisanship when drawing maps could be unconstitutional. But past justices haven't been able to agree on an objective way to measure partisanship, said Rick Pildes, an expert on redistricting law at New York University, when he spoke to The Fix in January. Some redistricting experts think O'Malley's candid admission might be the tipping point needed for the Supreme Court to step in.

The court also heard a case from Wisconsin in October that challenged Republicans' drawing of state legislative maps for being overtly partisan. No decision has come from that yet. And in Pennsylvania, the state's Supreme Court threw out the entire district map and redrew it with what it said were fairer lines. This could hand as many as half a dozen congressional seats to Democrats in November.

While it has mostly been Republican line-drawing at issue, it's not because Republicans are scientifically proven to gerrymander more than Democrats.

It's simply a reflection of who was in power in states that let legislatures draw the lines after the 2010 census.

The theory is “who's in power will gerrymander,” and that's underscored by this Maryland case. In the 1980s and 1990s, Democratic California was considered the most aggressively gerrymandered map in the country.

The process of redrawing district lines to give an advantage to one party over another is called "gerrymandering." Here's how it works. (Daron Taylor/The Washington Post)

The fact that both parties gerrymander is important to keep in mind as the pendulum of line-drawing swings a bit more toward Democrats with all these recent court cases.

Ahead of the map-drawing process after the 2020 census comes out, Democrats are investing millions to get courts to redraw maps, or at the very least to elect Democratic governors in November who can veto Republican-drawn maps and send the process to the court. That strategy is already working, the latest example being Virginia, where a Democratic governor won in November.

In a meeting with reporters in February, Democratic governors framed their new focus on fighting Republican gerrymandering as a way to fight for more democratic representation, rather than putting their party in power of map-drawing.

“This is not about our desire to rig the map,” Connecticut Gov. Dannel Malloy (D) said.

But when pressed, these Democratic governors wouldn't commit to supporting independent redistricting commissions or some other kind of nonpartisan process if they got the map-drawing power after the 2020 census.

That's because when you have the pen in your hand and the chance to lock your party in power for a decade, “that is a temptation most politicians find they couldn't avoid,” Pildes said.

But as courts start to punish extreme partisan gerrymandering, it's possible in the near future that both parties will have to avoid that temptation.