File tree 2 files changed +10
-7
lines changed
2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -96,9 +96,9 @@ namespace DuiLib {
96
96
faw::string_t sText = GetText ();
97
97
m_bNeedEstimateSize = false ;
98
98
m_szAvailableLast = szAvailable;
99
- m_cxyFixedLast = m_cxyFixed;
99
+ m_cxyFixedLast = GetManager ()-> GetDPIObj ()-> Scale ( m_cxyFixed) ;
100
100
if (sText .empty ())
101
- return { m_cxyFixed .cx , m_cxyFixed .cy };
101
+ return { m_cxyFixedLast .cx , m_cxyFixedLast .cy };
102
102
// 自动计算宽度
103
103
if ((m_uTextStyle & DT_SINGLELINE) != 0 ) {
104
104
// 高度
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ namespace DuiLib {
15
15
}
16
16
17
17
SIZE CTileLayoutUI::GetItemSize () const {
18
+ if (m_pManager) return m_pManager->GetDPIObj ()->Scale (m_szItem);
18
19
return m_szItem;
19
20
}
20
21
@@ -48,10 +49,11 @@ namespace DuiLib {
48
49
rc = m_rcItem;
49
50
50
51
// Adjust for inset
51
- rc.left += m_rcInset.left ;
52
- rc.top += m_rcInset.top ;
53
- rc.right -= m_rcInset.right ;
54
- rc.bottom -= m_rcInset.bottom ;
52
+ auto rcInset = GetInset ();
53
+ rc.left += rcInset.left ;
54
+ rc.top += rcInset.top ;
55
+ rc.right -= rcInset.right ;
56
+ rc.bottom -= rcInset.bottom ;
55
57
56
58
if (m_items.GetSize () == 0 ) {
57
59
ProcessScrollBar (rc, 0 , 0 );
@@ -62,7 +64,8 @@ namespace DuiLib {
62
64
if (m_pHorizontalScrollBar && m_pHorizontalScrollBar->IsVisible ()) rc.bottom -= m_pHorizontalScrollBar->GetFixedHeight ();
63
65
64
66
// Position the elements
65
- if (m_szItem.cx > 0 ) m_nColumns = (rc.right - rc.left ) / m_szItem.cx ;
67
+ auto szItem = GetItemSize ();
68
+ if (szItem.cx > 0 ) m_nColumns = (rc.right - rc.left ) / szItem.cx ;
66
69
if (m_nColumns == 0 ) m_nColumns = 1 ;
67
70
68
71
int cyNeeded = 0 ;
You can’t perform that action at this time.
0 commit comments