diff --git a/src/laybasic/laybasic/layTextInfo.cc b/src/laybasic/laybasic/layTextInfo.cc
index c337792dd..b93fea985 100644
--- a/src/laybasic/laybasic/layTextInfo.cc
+++ b/src/laybasic/laybasic/layTextInfo.cc
@@ -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;
diff --git a/src/laybasic/unit_tests/layTextInfoTests.cc b/src/laybasic/unit_tests/layTextInfoTests.cc
index 149065814..a0613f2db 100644
--- a/src/laybasic/unit_tests/layTextInfoTests.cc
+++ b/src/laybasic/unit_tests/layTextInfoTests.cc
@@ -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)");
}
diff --git a/src/layui/layui/LayoutViewConfigPage2b.ui b/src/layui/layui/LayoutViewConfigPage2b.ui
index 567b2f626..5d0ce4142 100644
--- a/src/layui/layui/LayoutViewConfigPage2b.ui
+++ b/src/layui/layui/LayoutViewConfigPage2b.ui
@@ -241,9 +241,10 @@
text_group
text_font_cb
- text_apply_trans_scale_cbx
- text_def_size_edit
text_color_pb
+ text_def_size_edit
+ text_apply_trans_scale_cbx
+ text_apply_trans_rotate_cbx
show_properties_cbx