mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Default touch control layout improvement in portrait, fix insets on pause screen in portrait
This commit is contained in:
+4
-1
@@ -824,7 +824,8 @@ void InitPadLayout(TouchControlConfig *config, DeviceOrientation orientation, fl
|
||||
const float scale = globalScale;
|
||||
const int halfW = xres / 2;
|
||||
|
||||
const float screenBottom = orientation == DeviceOrientation::Portrait ? (yres - yres * 0.13f) : yres;
|
||||
const bool portrait = orientation == DeviceOrientation::Portrait;
|
||||
const float screenBottom = portrait ? (yres - yres * 0.13f) : yres;
|
||||
|
||||
auto initTouchPos = [=](ConfigTouchPos *touch, float x, float y, float extraScale = 1.0f) {
|
||||
if (touch->x == -1.0f || touch->y == -1.0f) {
|
||||
@@ -863,6 +864,8 @@ void InitPadLayout(TouchControlConfig *config, DeviceOrientation orientation, fl
|
||||
int Action_button_center_Y = screenBottom - Action_button_spacing * 2;
|
||||
if (config->touchRightAnalogStick.show) {
|
||||
Action_button_center_Y -= 150 * scale;
|
||||
} else if (portrait) {
|
||||
Action_button_center_Y -= 120 * scale;
|
||||
}
|
||||
initTouchPos(&config->touchActionButtonCenter, Action_button_center_X, Action_button_center_Y);
|
||||
|
||||
|
||||
+3
-1
@@ -41,7 +41,9 @@ protected:
|
||||
void CreateViews() override;
|
||||
void update() override;
|
||||
UI::Margins RootMargins() const override;
|
||||
|
||||
ViewLayoutMode LayoutMode() const override {
|
||||
return ViewLayoutMode::ApplyInsets;
|
||||
}
|
||||
// For processing of certain mapped keys.
|
||||
bool UnsyncKey(const KeyInput &key) override;
|
||||
void UnsyncAxis(const AxisInput *axes, size_t count) override;
|
||||
|
||||
Reference in New Issue
Block a user