Skip to content

Commit 5214a73

Browse files
committed
gui: address clang-tidy feedback
Signed-off-by: Peter Gadfort <[email protected]>
1 parent b1c712e commit 5214a73

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/gui/src/renderThread.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@
1313
#include <exception>
1414
#include <iterator>
1515
#include <mutex>
16+
#include <optional>
1617
#include <set>
1718
#include <string>
1819
#include <utility>
1920
#include <vector>
2021

2122
#include "boost/geometry/geometry.hpp"
23+
#include "boost/geometry/index/parameters.hpp"
24+
#include "boost/geometry/index/predicates.hpp"
25+
#include "boost/geometry/index/rtree.hpp"
2226
#include "gui/gui.h"
2327
#include "layoutViewer.h"
2428
#include "odb/db.h"
@@ -1607,10 +1611,8 @@ void RenderThread::setupIOPins(odb::dbBlock* block, const odb::Rect& bounds)
16071611
checked.insert(bterm);
16081612

16091613
QString current_text = QString::fromStdString(pin->getName());
1610-
int text_width = font_metrics.boundingRect(current_text).width();
1611-
if (text_width > largest_text_width) {
1612-
largest_text_width = text_width;
1613-
}
1614+
const int text_width = font_metrics.boundingRect(current_text).width();
1615+
largest_text_width = std::max(text_width, largest_text_width);
16141616
while (largest_text_width > available_space) {
16151617
if (font_size <= minimum_font_size) {
16161618
break;
@@ -1816,7 +1818,7 @@ void RenderThread::drawIOPins(Painter& painter,
18161818

18171819
bool do_rotate = false;
18181820
auto anchor = pin.anchor;
1819-
if (pin.can_rotate) {
1821+
if (pin.can_rotate && pin.rect) {
18201822
if (pin_text_spec_shapes.qbegin(bgi::intersects(*pin.rect)
18211823
&& bgi::satisfies([&](const auto& other) {
18221824
return !bg::equals(other, *pin.rect);

0 commit comments

Comments
 (0)