Skip to content

Commit

Permalink
Merge pull request The-OpenROAD-Project#6121 from gadfort/fix-gui-tracks
Browse files Browse the repository at this point in the history
gui: ensure color and brush is set correctly on layer drawing
  • Loading branch information
maliberty authored Nov 8, 2024
2 parents 59bd6f6 + dc593ba commit c6e6fdd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/gui/src/renderThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@ void RenderThread::drawTracks(dbTechLayer* layer,
const Rect draw_bounds = block_bounds.intersect(bounds);
const int min_resolution = viewer_->shapeSizeLimit();

QPen pen(getColor(layer));
pen.setCosmetic(true);
painter->setPen(pen);
painter->setBrush(Qt::NoBrush);

bool is_horizontal = layer->getDirection() == dbTechLayerDir::HORIZONTAL;
std::vector<int> grids;
if ((!is_horizontal && viewer_->options_->arePrefTracksVisible())
Expand Down Expand Up @@ -994,10 +999,9 @@ void RenderThread::drawLayer(QPainter* painter,

// Now draw the fills
if (viewer_->options_->areFillsVisible()) {
QColor color = getColor(layer).lighter(50);
Qt::BrushStyle brush_pattern = getPattern(layer);
painter->setBrush(QBrush(color, brush_pattern));
painter->setPen(QPen(color, 0));
QColor fill_color = getColor(layer).lighter(50);
painter->setBrush(QBrush(fill_color, brush_pattern));
painter->setPen(QPen(fill_color, 0));
auto iter = viewer_->search_.searchFills(block,
layer,
bounds.xMin(),
Expand All @@ -1018,6 +1022,9 @@ void RenderThread::drawLayer(QPainter* painter,
}
}

painter->setBrush(QBrush(color, brush_pattern));
painter->setPen(QPen(color, 0));

if (draw_shapes) {
if (viewer_->options_->areIOPinsVisible()) {
utl::Timer io_pins;
Expand Down

0 comments on commit c6e6fdd

Please sign in to comment.