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

◆ UpdateScroll()

void ScrollBarContainer::UpdateScroll ( int mouse_x,
int mouse_y,
bool is_dragging )
inlineprotected

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

165 {
166 m_root.Update();
167 Content.Update();
168 float width;
169
170 m_root.GetScreenSize(width, m_root_height);
171 Content.GetScreenSize(width, m_content_height);
172
173 if (m_scrolling)
174 {
175 if (is_dragging)
176 {
177 float diff = (mouse_y - m_scrolling_mouse_pos);
178 float scroller_height = (m_root_height / m_content_height) * m_root_height;
179 m_position = m_scrolling_start_pos + (diff / (m_root_height - scroller_height));
180 if (m_position < 0) m_position = 0;
181 if (m_position > 1) m_position = 1;
182 }
183 else
184 {
185 m_scrolling = false;
187 }
188 }
189
191 }
float m_content_height
Определения ScrollBarContainer.c:12
float m_root_height
Определения ScrollBarContainer.c:11
Widget m_root
Определения ScrollBarContainer.c:8
void StopScrolling()
Определения ScrollBarContainer.c:155
Widget Content
Определения ScrollBarContainer.c:5
int m_scrolling_mouse_pos
Определения ScrollBarContainer.c:16
float m_position
Определения ScrollBarContainer.c:13
bool m_scrolling
Определения ScrollBarContainer.c:14
void UpdateScroller()
Определения ScrollBarContainer.c:104
float m_scrolling_start_pos
Определения ScrollBarContainer.c:15

Перекрестные ссылки Content, m_content_height, m_position, m_root, m_root_height, m_scrolling, m_scrolling_mouse_pos, m_scrolling_start_pos, StopScrolling() и UpdateScroller().