DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ UpdateScroller()

void ScrollBarContainer::UpdateScroller ( )
inlineprotected

См. определение в файле ScrollBarContainer.c строка 104

105 {
106 m_root.Update();
107 Content.Update();
108 float width;
109 float height;
110 float diff;
111 float scroller_height;
112
113 m_root.GetScreenSize(width, m_root_height);
114 Content.GetScreenSize(width, m_content_height);
115
117 if (diff <= 0)
118 {
119 Content.SetPos(0,0);
120 Scroller.Show(false);
121 ScrollBar.Show(false);
122 m_position = 0;
123 return;
124 }
125
126 scroller_height = (m_root_height / m_content_height) * m_root_height;
127
128 ScrollBar.Show(true);
129 Scroller.Show(true);
130 Scroller.GetSize(width, height);
131 Scroller.SetSize(width, scroller_height);
132
133 float pos = ( -m_content_height * m_position );
134
135 if( pos <= -diff )
136 pos = -diff;
137
138 Scroller.SetPos(0, -pos);
139
140 if(Invert)
141 Content.SetPos(0, -(diff + (-diff * m_position)));
142 else
143 Content.SetPos(0, pos);
144 }
reference bool Invert
Определения ScrollBarContainer.c:4
float m_content_height
Определения ScrollBarContainer.c:12
Widget Scroller
Определения ScrollBarContainer.c:7
float m_root_height
Определения ScrollBarContainer.c:11
Widget m_root
Определения ScrollBarContainer.c:8
Widget Content
Определения ScrollBarContainer.c:5
float m_position
Определения ScrollBarContainer.c:13
Widget ScrollBar
Определения ScrollBarContainer.c:6

Перекрестные ссылки Content, Invert, m_content_height, m_position, m_root, m_root_height, ScrollBar и Scroller.

Используется в OnMouseWheel(), OnResize(), OnWidgetScriptInit(), ScrollFixedAmount(), ScrollToBottom(), ScrollToPos(), ScrollToTop() и UpdateScroll().