-
Notifications
You must be signed in to change notification settings - Fork 909
gui: fix bbox descriptor #10575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
gui: fix bbox descriptor #10575
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -744,6 +744,11 @@ dbITerm* dbITerm::getITerm(dbBlock* block_, uint32_t dbid) | |
| Rect dbITerm::getBBox() | ||
| { | ||
| dbMTerm* term = getMTerm(); | ||
| if (term->getMPins().empty()) { | ||
| Rect bbox; | ||
| bbox.mergeInit(); | ||
| return bbox; | ||
| } | ||
| Rect bbox = term->getBBox(); | ||
|
Comment on lines
+747
to
752
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of checking if Rect bbox = term->getBBox();
if (bbox.isInverted()) {
return bbox;
} |
||
| const odb::dbTransform inst_xfm = getInst()->getTransform(); | ||
| inst_xfm.apply(bbox); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
bboxis inverted, applying the transform viaxform.apply(bbox)will corrupt the coordinates (due to integer overflow/underflow during translation/rotation ofINT_MAX/INT_MIN), which can make the box appear non-inverted and cause!bbox.isInverted()to incorrectly returntrue. It is safer to check ifbboxis inverted and returnfalsebefore applying the transform.