MCPcopy Create free account
hub / github.com/cinience/RedisStudio / GetThumbRect

Method GetThumbRect

DuiLib/Control/UISlider.cpp:52–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 }
51
52 RECT CSliderUI::GetThumbRect() const
53 {
54 if( m_bHorizontal ) {
55 int left = m_rcItem.left + (m_rcItem.right - m_rcItem.left - m_szThumb.cx) * (m_nValue - m_nMin) / (m_nMax - m_nMin);
56 int top = (m_rcItem.bottom + m_rcItem.top - m_szThumb.cy) / 2;
57 return CDuiRect(left, top, left + m_szThumb.cx, top + m_szThumb.cy);
58 }
59 else {
60 int left = (m_rcItem.right + m_rcItem.left - m_szThumb.cx) / 2;
61 int top = m_rcItem.bottom - m_szThumb.cy - (m_rcItem.bottom - m_rcItem.top - m_szThumb.cy) * (m_nValue - m_nMin) / (m_nMax - m_nMin);
62 return CDuiRect(left, top, left + m_szThumb.cx, top + m_szThumb.cy);
63 }
64 }
65
66 LPCTSTR CSliderUI::GetThumbImage() const
67 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected