From 83d37d4187d97e6158a01441b6704a38b9d6939f Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 8 Oct 2022 10:38:54 +0200 Subject: [PATCH] Some bug fixes --- src/edt/edt/edtPropertiesPages.cc | 14 ++++++++++---- src/layui/layui/layPropertiesDialog.cc | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/edt/edt/edtPropertiesPages.cc b/src/edt/edt/edtPropertiesPages.cc index c7ad5c989..d831d17fe 100644 --- a/src/edt/edt/edtPropertiesPages.cc +++ b/src/edt/edt/edtPropertiesPages.cc @@ -461,8 +461,10 @@ PolygonPropertiesPage::description (size_t entry) const } else if (sh.holes () > 0) { return ShapePropertiesPage::description (entry) + " - " + tl::sprintf (tl::to_string (tr ("Polygon(%d points, %d holes)")), npts, sh.holes ()); } else { + db::Polygon poly; + sh.polygon (poly); db::CplxTrans dbu_trans (dbu (entry)); - return ShapePropertiesPage::description (entry) + " - " + tl::sprintf (tl::to_string (tr ("Polygon%s")), (dbu_trans * sh.polygon ()).to_string ()); + return ShapePropertiesPage::description (entry) + " - " + tl::sprintf (tl::to_string (tr ("Polygon%s")), (dbu_trans * poly).to_string ()); } } @@ -877,8 +879,10 @@ std::string TextPropertiesPage::description (size_t entry) const { const db::Shape &sh = shape (entry); + db::Text text; + sh.text (text); db::CplxTrans dbu_trans (dbu (entry)); - return ShapePropertiesPage::description (entry) + " - " + tl::sprintf (tl::to_string (tr ("Text%s")), (dbu_trans * sh.text ()).to_string ()); + return ShapePropertiesPage::description (entry) + " - " + tl::sprintf (tl::to_string (tr ("Text%s")), (dbu_trans * text).to_string ()); } void @@ -1018,10 +1022,12 @@ static std::string path_description (const db::Shape &sh, double dbu) { size_t npts = count_path_points (sh); if (npts > 4) { - return tl::sprintf (tl::to_string (tr ("Path(%d points, w=%s)")), npts, tl::micron_to_string (sh.path_width () * dbu)); + return tl::sprintf (tl::to_string (tr ("Path(%d points, w=%.12g)")), npts, sh.path_width () * dbu); } else { db::CplxTrans dbu_trans (dbu); - return tl::sprintf (tl::to_string (tr ("Path%s")), (dbu_trans * sh.path ()).to_string ()); + db::Path path; + sh.path (path); + return tl::sprintf (tl::to_string (tr ("Path%s")), (dbu_trans * path).to_string ()); } } diff --git a/src/layui/layui/layPropertiesDialog.cc b/src/layui/layui/layPropertiesDialog.cc index f27d8da98..165c3bac5 100644 --- a/src/layui/layui/layPropertiesDialog.cc +++ b/src/layui/layui/layPropertiesDialog.cc @@ -213,6 +213,7 @@ PropertiesDialog::PropertiesDialog (QWidget * /*parent*/, db::Manager *manager, // if at end disable the "Next" button and return (this may only happen at the first call) mp_tree_model = new PropertiesTreeModel (this, mp_ui->tree->iconSize ().width (), mp_ui->tree->iconSize ().height ()); mp_ui->tree->setModel (mp_tree_model); + mp_ui->tree->header ()->setSectionResizeMode (QHeaderView::ResizeToContents); mp_ui->tree->expandAll (); m_signals_enabled = false;