1
// Copyright (c) 2012- PPSSPP Project.
3
// This program is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, version 2.0 or later versions.
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
// GNU General Public License 2.0 for more details.
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
15
// Official git repository and contact information can be found at
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
19
#include "ui/ui_context.h"
21
#include "UI/DisplayLayoutEditor.h"
23
void MultiTouchDisplay::GetContentDimensions(const UIContext &dc, float &w, float &h) const {
24
const AtlasImage &image = dc.Draw()->GetAtlas()->images[img_];
29
void MultiTouchDisplay::Touch(const TouchInput &input) {
30
if ((input.flags & TOUCH_DOWN) && bounds_.Contains(input.x, input.y)) {
31
pointerDownMask_ |= 1 << input.id;
33
if (input.flags & TOUCH_MOVE) {
34
if (bounds_.Contains(input.x, input.y))
35
pointerDownMask_ |= 1 << input.id;
37
pointerDownMask_ &= ~(1 << input.id);
39
if (input.flags & TOUCH_UP) {
40
pointerDownMask_ &= ~(1 << input.id);
42
if (input.flags & TOUCH_RELEASE_ALL) {
48
void MultiTouchDisplay::Draw(UIContext &dc) {
51
uint32_t color = colorAlpha(0xFFFFFF, opacity);
52
dc.Draw()->DrawImageRotated(img_, bounds_.centerX(), bounds_.centerY(), scale, angle_ * (M_PI * 2 / 360.0f), color, flipImageH_);