mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Merge pull request #12567 from iota97/snap2
Use snap grid on resize as well
This commit is contained in:
commit
8203c79e43
1 changed files with 6 additions and 1 deletions
|
@ -288,6 +288,11 @@ bool TouchControlLayoutScreen::touch(const TouchInput &touch) {
|
|||
float diffX = (touch.x - startX_);
|
||||
float diffY = -(touch.y - startY_);
|
||||
|
||||
// Snap to grid
|
||||
if (g_Config.bTouchSnapToGrid) {
|
||||
diffX -= (int)(touch.x - startX_) % (g_Config.iTouchSnapGridSize/2);
|
||||
diffY += (int)(touch.y - startY_) % (g_Config.iTouchSnapGridSize/2);
|
||||
}
|
||||
float movementScale = 0.02f;
|
||||
float newScale = startScale_ + diffY * movementScale;
|
||||
float newSpacing = startSpacing_ + diffX * movementScale;
|
||||
|
@ -363,7 +368,7 @@ void TouchControlLayoutScreen::CreateViews() {
|
|||
// ->OnChange.Handle(this, &GameSettingsScreen::OnChangeControlScaling);
|
||||
|
||||
CheckBox *snap = new CheckBox(&g_Config.bTouchSnapToGrid, di->T("Snap"), "", new AnchorLayoutParams(leftColumnWidth, WRAP_CONTENT, 10, NONE, NONE, 228));
|
||||
PopupSliderChoice *gridSize = new PopupSliderChoice(&g_Config.iTouchSnapGridSize, 1, 256, di->T("Grid"), screenManager(), "", new AnchorLayoutParams(leftColumnWidth, WRAP_CONTENT, 10, NONE, NONE, 158));
|
||||
PopupSliderChoice *gridSize = new PopupSliderChoice(&g_Config.iTouchSnapGridSize, 2, 256, di->T("Grid"), screenManager(), "", new AnchorLayoutParams(leftColumnWidth, WRAP_CONTENT, 10, NONE, NONE, 158));
|
||||
gridSize->SetEnabledPtr(&g_Config.bTouchSnapToGrid);
|
||||
|
||||
mode_ = new ChoiceStrip(ORIENT_VERTICAL, new AnchorLayoutParams(leftColumnWidth, WRAP_CONTENT, 10, NONE, NONE, 140 + 158 + 64 + 10));
|
||||
|
|
Loading…
Add table
Reference in a new issue