Skip to content

Commit b1c712e

Browse files
committed
gui: reserve polygon size
Signed-off-by: Peter Gadfort <[email protected]>
1 parent e6ca9dd commit b1c712e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/gui/src/painter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ class GuiPainter : public Painter
135135
void drawPolygon(const std::vector<odb::Point>& points) override
136136
{
137137
QPolygon poly;
138+
poly.reserve(points.size());
138139
for (const auto& pt : points) {
139140
poly.append(QPoint(pt.x(), pt.y()));
140141
}

src/gui/src/renderThread.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,8 +1705,7 @@ void RenderThread::drawIOPins(Painter& painter,
17051705
continue;
17061706
}
17071707

1708-
Point pin_center((box->xMin() + box->xMax()) / 2,
1709-
(box->yMin() + box->yMax()) / 2);
1708+
const Point pin_center = box->getBox().center();
17101709

17111710
auto dist_to_left = std::abs(box->xMin() - die_area.xMin());
17121711
auto dist_to_right = std::abs(box->xMax() - die_area.xMax());

0 commit comments

Comments
 (0)