aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/platform/psp/image_viewer.cpp16
-rw-r--r--backends/platform/psp/image_viewer.h4
2 files changed, 10 insertions, 10 deletions
diff --git a/backends/platform/psp/image_viewer.cpp b/backends/platform/psp/image_viewer.cpp
index 66512e450b..b859fe21d1 100644
--- a/backends/platform/psp/image_viewer.cpp
+++ b/backends/platform/psp/image_viewer.cpp
@@ -218,16 +218,16 @@ void ImageViewer::render() {
// move the image slightly. Note that we count on the renderer's timing
switch (_movement) {
case EVENT_MOVE_LEFT:
- moveImageX(-2);
+ moveImageX(-_visibleWidth / 100.0f);
break;
case EVENT_MOVE_UP:
- moveImageY(-2);
+ moveImageY(-_visibleHeight / 100.0f);
break;
case EVENT_MOVE_RIGHT:
- moveImageX(2);
+ moveImageX(_visibleWidth / 100.0f);
break;
case EVENT_MOVE_DOWN:
- moveImageY(2);
+ moveImageY(_visibleHeight / 100.0f);
break;
default:
break;
@@ -255,19 +255,19 @@ void ImageViewer::setZoom(float value) {
setOffsetParams();
}
-void ImageViewer::moveImageX(int val) {
+void ImageViewer::moveImageX(float val) {
float newVal = _centerX + val;
- if (newVal < 0 || newVal > PSP_SCREEN_WIDTH)
+ if (newVal - (_visibleWidth / 2) > PSP_SCREEN_WIDTH - 4 || newVal + (_visibleWidth / 2) < 4)
return;
_centerX = newVal;
setOffsetParams();
}
-void ImageViewer::moveImageY(int val) {
+void ImageViewer::moveImageY(float val) {
float newVal = _centerY + val;
- if (newVal < 0 || newVal > PSP_SCREEN_HEIGHT)
+ if (newVal - (_visibleHeight / 2) > PSP_SCREEN_HEIGHT - 4 || newVal + (_visibleHeight / 2) < 4)
return;
_centerY = newVal;
setOffsetParams();
diff --git a/backends/platform/psp/image_viewer.h b/backends/platform/psp/image_viewer.h
index 1946b0ffe2..ef8b196dbe 100644
--- a/backends/platform/psp/image_viewer.h
+++ b/backends/platform/psp/image_viewer.h
@@ -66,8 +66,8 @@ private:
void loadLastImage();
void setViewerButtons(bool active);
void setConstantRendererOptions();
- void moveImageX(int val);
- void moveImageY(int val);
+ void moveImageX(float val);
+ void moveImageY(float val);
bool load(int imageNum);
void unload();
void runLoop(); // to get total pausing we have to do our own loop