Skip to content

gui: avoid pre-filling with (0,0) points#7811

Merged
maliberty merged 1 commit intoThe-OpenROAD-Project:masterfrom
gudeh:gui-avoid-qpolygon-pre-filling
Jul 15, 2025
Merged

gui: avoid pre-filling with (0,0) points#7811
maliberty merged 1 commit intoThe-OpenROAD-Project:masterfrom
gudeh:gui-avoid-qpolygon-pre-filling

Conversation

@gudeh
Copy link
Copy Markdown
Contributor

@gudeh gudeh commented Jul 15, 2025

GSOC intern @gs-chaitanya is working on implementing rectlinear floorplans. During his work we noticed a bug, we get a DIE horizontal line going to the origin (0,0) even though the die does not touch the origin:
Screenshot from 2025-07-14 12-48-50

This PR fixes this issue. I noticed QPolygon initialization is pre-filling its values with multiple (0,0) values, we end up getting double the objects we would need:

  QPolygon[0]: (0, 0)
  QPolygon[1]: (0, 0)
  QPolygon[2]: (0, 0)
  QPolygon[3]: (0, 0)
  QPolygon[4]: (0, 0)
  QPolygon[5]: (0, 0)
  QPolygon[6]: (0, 0)
  QPolygon[7]: (0, 0)
  QPolygon[8]: (0, 0)
  QPolygon[9]: (300000, 20000)
  QPolygon[10]: (300000, 400000)
  QPolygon[11]: (20000, 400000)
  QPolygon[12]: (20000, 600000)
  QPolygon[13]: (800000, 600000)
  QPolygon[14]: (800000, 400000)
  QPolygon[15]: (500000, 400000)
  QPolygon[16]: (500000, 20000)
  QPolygon[17]: (300000, 20000)

Changing the constructor we use, we get the expected values only:

  QPolygonF[0]: (300000.000, 20000.000)
  QPolygonF[1]: (300000.000, 400000.000)
  QPolygonF[2]: (20000.000, 400000.000)
  QPolygonF[3]: (20000.000, 600000.000)
  QPolygonF[4]: (800000.000, 600000.000)
  QPolygonF[5]: (800000.000, 400000.000)
  QPolygonF[6]: (500000.000, 400000.000)
  QPolygonF[7]: (500000.000, 20000.000)
  QPolygonF[8]: (300000.000, 20000.000)

Finally, with the fix we get:
Screenshot from 2025-07-14 13-36-43

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
@gudeh
Copy link
Copy Markdown
Contributor Author

gudeh commented Jul 15, 2025

FYI @eder-matheus @QuantamHD

@gudeh
Copy link
Copy Markdown
Contributor Author

gudeh commented Jul 15, 2025

I also noticed we use the same constructor type at RenderThread::drawLayer, although I haven't investigated it yet.

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@gadfort gadfort self-requested a review July 15, 2025 12:19
@maliberty maliberty merged commit ed5f64d into The-OpenROAD-Project:master Jul 15, 2025
11 checks passed
@gudeh gudeh deleted the gui-avoid-qpolygon-pre-filling branch July 15, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants