Открыть боковую панель
OpenXRay
xray-16
Коммиты
1ef6b747
Коммит
1ef6b747
создал
Авг 09, 2023
по автору
xottab-duty
Просмотр файлов
CUICursor: ability to warp cursor to specific UI window position
владелец
cce060b5
Изменения
2
Скрыть пробелы
Построчно
Рядом
src/xrUICore/Cursor/UICursor.cpp
Просмотр файла @
1ef6b747
...
...
@@ -152,3 +152,23 @@ void CUICursor::SetUICursorPosition(Fvector2 pos)
p
.
y
=
iFloor
(
vPos
.
y
/
correction
.
y
);
pInput
->
iSetMousePos
(
p
);
}
void
CUICursor
::
WarpToWindow
(
CUIWindow
*
wnd
,
bool
change_visibility
/*= true*/
)
{
if
(
!
wnd
)
{
if
(
change_visibility
)
Hide
();
return
;
}
if
(
!
IsVisible
()
&&
change_visibility
)
Show
();
Fvector2
pos
;
wnd
->
GetAbsolutePos
(
pos
);
Fvector2
size
=
wnd
->
GetWndSize
();
const
Fvector2
sizeOfThird
=
Fvector2
(
size
).
div
(
3
);
pos
.
add
(
size
).
sub
(
sizeOfThird
);
SetUICursorPosition
(
pos
);
}
src/xrUICore/Cursor/UICursor.h
Просмотр файла @
1ef6b747
...
...
@@ -26,6 +26,7 @@ public:
Fvector2
GetCursorPosition
();
void
SetUICursorPosition
(
Fvector2
pos
);
void
WarpToWindow
(
CUIWindow
*
wnd
,
bool
change_visibility
=
true
);
void
UpdateCursorPosition
(
int
_dx
,
int
_dy
);
void
OnDeviceReset
()
override
;
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать