mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-21 02:09:05 +02:00
AnchorLayout: Allow centering separately for horizontal and vertical
This commit is contained in:
1 parent
0453fb5449
commit
9de8e75709
16 files changed
+71
-61
No files matched your search
@@ -44,7 +44,7 @@ static u32 GetButtonColor() {
|
||||
class DragDropButton : public MultiTouchButton {
|
||||
public:
|
||||
DragDropButton(ConfigTouchPos &pos, const char *key, ImageID bgImg, ImageID img, const Bounds &screenBounds)
|
||||
: MultiTouchButton(key, bgImg, bgImg, img, pos.scale, new UI::AnchorLayoutParams(pos.x * screenBounds.w, pos.y * screenBounds.h, UI::NONE, UI::NONE, true)),
|
||||
: MultiTouchButton(key, bgImg, bgImg, img, pos.scale, new UI::AnchorLayoutParams(pos.x * screenBounds.w, pos.y * screenBounds.h, UI::NONE, UI::NONE, UI::Centering::Both)),
|
||||
x_(pos.x), y_(pos.y), theScale_(pos.scale), screenBounds_(screenBounds) {
|
||||
scale_ = theScale_;
|
||||
}
|
||||
@@ -412,7 +412,7 @@ bool ControlLayoutView::Touch(const TouchInput &touch) {
|
||||
}
|
||||
|
||||
newPos = ClampTo(newPos, validRange);
|
||||
pickedControl_->ReplaceLayoutParams(new AnchorLayoutParams(newPos.x, newPos.y, NONE, NONE, true));
|
||||
pickedControl_->ReplaceLayoutParams(new AnchorLayoutParams(newPos.x, newPos.y, NONE, NONE, Centering::Both));
|
||||
} else if (mode_ == 1) {
|
||||
// Resize. Vertical = scaling, horizontal = spacing;
|
||||
// Up should be bigger so let's negate in that direction
|
||||
|
||||
Reference in new issue
Block a user