Fixed texts, tab order on config page, compiler warnings

This commit is contained in:
Matthias Koefferlein 2026-04-11 00:00:44 +02:00
parent ade8a54ede
commit b39556d645
3 changed files with 9 additions and 9 deletions

View File

@ -56,7 +56,7 @@ TextInfo::bbox (const db::DText &text, const db::DCplxTrans &vp_trans) const
if ((m_apply_text_trans_mode & 2) != 0 && font != db::NoFont && font != db::DefaultFont) {
tt = text.trans ();
} else {
tt = db::DTrans (vp_trans.fp_trans ().inverted ().angle (), tt.disp ());
tt = db::DTrans (vp_trans.fp_trans ().inverted ().angle (), text.trans ().disp ());
}
if (((m_apply_text_trans_mode & 1) != 0) && font != db::NoFont && font != db::DefaultFont) {
h = text.size () > 0 ? text.size () : m_default_text_size;

View File

@ -128,8 +128,8 @@ TEST(1)
lv.apply_text_trans (true);
lv.apply_text_trans_mode (1);
ti = lay::TextInfo (&lv);
EXPECT_EQ (ti.bbox (text3, db::DCplxTrans ()).to_string (), "(12,20.6;36.4,34.2)");
// with apply_text_trans false, the global transformation does change the text
EXPECT_EQ (ti.bbox (text3, db::DCplxTrans ()).to_string (), "(12,15;134,83)");
// with apply_text_trans_mode not including rotation, the global transformation does change the text
// bounding box.
EXPECT_EQ (ti.bbox (text, db::DCplxTrans ()).to_string (), "(12,20.6;24,27)");
EXPECT_EQ (ti.bbox (text, db::DCplxTrans (2.0)).to_string (), "(11,19.6;23,26)");
@ -139,10 +139,9 @@ TEST(1)
lv.apply_text_trans (true);
lv.apply_text_trans_mode (2);
ti = lay::TextInfo (&lv);
EXPECT_EQ (ti.bbox (text3, db::DCplxTrans ()).to_string (), "(12,20.6;36.4,34.2)");
// with apply_text_trans false, the global transformation does change the text
// bounding box.
EXPECT_EQ (ti.bbox (text3, db::DCplxTrans ()).to_string (), "(-4.2,22;9.4,46.4)");
// with apply_text_trans including rotation, the global transformation changes the text bounding box
EXPECT_EQ (ti.bbox (text, db::DCplxTrans ()).to_string (), "(12,20.6;24,27)");
EXPECT_EQ (ti.bbox (text, db::DCplxTrans (2.0)).to_string (), "(11,19.6;23,26)");
EXPECT_EQ (ti.bbox (text, db::DCplxTrans (db::DFTrans (1))).to_string (), "(10.6,6;17,18)");
EXPECT_EQ (ti.bbox (text, db::DCplxTrans (db::DFTrans (1))).to_string (), "(12,20.6;24,27)");
}

View File

@ -241,9 +241,10 @@
<tabstops>
<tabstop>text_group</tabstop>
<tabstop>text_font_cb</tabstop>
<tabstop>text_apply_trans_scale_cbx</tabstop>
<tabstop>text_def_size_edit</tabstop>
<tabstop>text_color_pb</tabstop>
<tabstop>text_def_size_edit</tabstop>
<tabstop>text_apply_trans_scale_cbx</tabstop>
<tabstop>text_apply_trans_rotate_cbx</tabstop>
<tabstop>show_properties_cbx</tabstop>
</tabstops>
<resources/>