Merge branch 'master' into wip2

This commit is contained in:
Matthias Koefferlein 2023-05-18 19:00:24 +02:00
commit ba0aaef132
4 changed files with 26 additions and 14 deletions

View File

@ -85,15 +85,12 @@ Requires: libqt4-x11 >= 4.8.6
# OpenSuSE Leap 15 requirements
Requires: ruby >= 2.5
Requires: python3 >= 3.6
Requires: libqt4-x11 >= 4.8.7
%define buildopt -j2
%endif
%if "%{target_system}" == "opensuse15"
# OpenSuSE Leap 15 requirements
Requires: ruby >= 2.5
Requires: python3 >= 3.6
Requires: libqt4-x11 >= 4.8.7
Requires: libqt5-qtbase >= 5.15.2
Requires: libQt5PrintSupport5 >= 5.15.2
Requires: libQt5Designer5 >= 5.15.2
Requires: libQt5Multimedia5 >= 5.15.2
Requires: libQt5Svg5 >= 5.15.2
Requires: libQt5XmlPatterns5 >= 5.15.2
%define buildopt -j2
%endif

View File

@ -313,6 +313,7 @@ RegionDelegate *FlatRegion::add (const Region &other) const
if (other_flat) {
new_region->raw_polygons ().insert (other_flat->raw_polygons ().get_layer<db::Polygon, db::unstable_layer_tag> ().begin (), other_flat->raw_polygons ().get_layer<db::Polygon, db::unstable_layer_tag> ().end ());
new_region->raw_polygons ().insert (other_flat->raw_polygons ().get_layer<db::PolygonWithProperties, db::unstable_layer_tag> ().begin (), other_flat->raw_polygons ().get_layer<db::PolygonWithProperties, db::unstable_layer_tag> ().end ());
} else {
@ -343,6 +344,7 @@ RegionDelegate *FlatRegion::add_in_place (const Region &other)
if (other_flat) {
polygons.insert (other_flat->raw_polygons ().get_layer<db::Polygon, db::unstable_layer_tag> ().begin (), other_flat->raw_polygons ().get_layer<db::Polygon, db::unstable_layer_tag> ().end ());
polygons.insert (other_flat->raw_polygons ().get_layer<db::PolygonWithProperties, db::unstable_layer_tag> ().begin (), other_flat->raw_polygons ().get_layer<db::PolygonWithProperties, db::unstable_layer_tag> ().end ());
} else {

View File

@ -2081,6 +2081,24 @@ TEST(50_PropertiesFlat)
EXPECT_EQ (s.at_end (), true);
}
// "+" operator with properties (issue #1373)
TEST(50b_PropertiesFlat)
{
db::Region r, rr;
r.insert (db::Box (0, 0, 10, 20));
rr.insert (db::Box (0, 0, 100, 200));
rr.insert (db::BoxWithProperties (db::Box (1, 2, 101, 202), 1));
EXPECT_EQ ((db::Region () + rr).to_string (), "(0,0;0,200;100,200;100,0);(1,2;1,202;101,202;101,2)");
EXPECT_EQ ((rr + db::Region ()).to_string (), "(0,0;0,200;100,200;100,0);(1,2;1,202;101,202;101,2)");
EXPECT_EQ ((r + rr).to_string (), "(0,0;0,20;10,20;10,0);(0,0;0,200;100,200;100,0);(1,2;1,202;101,202;101,2)");
r += rr;
EXPECT_EQ (r.to_string (), "(0,0;0,20;10,20;10,0);(0,0;0,200;100,200;100,0);(1,2;1,202;101,202;101,2)");
}
TEST(51_PropertiesFlatFromLayout)
{
db::Layout ly;

View File

@ -506,11 +506,6 @@ LayoutView::init_ui (db::Manager *mgr)
mp_connector = new LayoutViewSignalConnector (mp_widget, this);
QVBoxLayout *vbl = new QVBoxLayout (mp_widget);
vbl->setContentsMargins (0, 0, 0, 0);
vbl->setSpacing (0);
vbl->addWidget (canvas ()->widget ());
if ((options () & LV_NoHierarchyPanel) == 0 && (options () & LV_Naked) == 0) {
QFrame *hierarchy_frame = new QFrame (0);