summaryrefslogtreecommitdiff
authoralwin <alwin>2004-04-05 00:09:04 (UTC)
committer alwin <alwin>2004-04-05 00:09:04 (UTC)
commitb0ceb8843ebe9ee3054faa98f08bd255df955aa3 (patch) (unidiff)
tree0ff209155b8b442b7810bc33b5e49cdd34d1fad2
parent7485cd42befd86ad035ef4fa29d6e8f728b1e211 (diff)
downloadopie-b0ceb8843ebe9ee3054faa98f08bd255df955aa3.zip
opie-b0ceb8843ebe9ee3054faa98f08bd255df955aa3.tar.gz
opie-b0ceb8843ebe9ee3054faa98f08bd255df955aa3.tar.bz2
ok, found the problem with moving the image via pen/mouse
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/imagescrollview.cpp22
-rw-r--r--noncore/graphics/opie-eye/gui/imagescrollview.h4
2 files changed, 17 insertions, 9 deletions
diff --git a/noncore/graphics/opie-eye/gui/imagescrollview.cpp b/noncore/graphics/opie-eye/gui/imagescrollview.cpp
index f36b717..019f376 100644
--- a/noncore/graphics/opie-eye/gui/imagescrollview.cpp
+++ b/noncore/graphics/opie-eye/gui/imagescrollview.cpp
@@ -2,2 +2,6 @@
2 2
3#include <opie2/odebug.h>
4
5using namespace Opie::Core;
6
3#include <qimage.h> 7#include <qimage.h>
@@ -12,3 +16,3 @@ ImageScrollView::ImageScrollView (const QImage&img, QWidget * parent, const char
12ImageScrollView::ImageScrollView (const QString&img, QWidget * parent, const char * name, WFlags f) 16ImageScrollView::ImageScrollView (const QString&img, QWidget * parent, const char * name, WFlags f)
13 :QScrollView(parent,name,f/*|Qt::WRepaintNoErase*/),_image_data(img) 17 :QScrollView(parent,name,f|Qt::WRepaintNoErase),_image_data(img)
14{ 18{
@@ -62,2 +66,3 @@ void ImageScrollView::drawContents(QPainter * p, int clipx, int clipy, int clipw
62 66
67/* using the real geometry points and not the translated points is wanted! */
63void ImageScrollView::viewportMouseMoveEvent(QMouseEvent* e) 68void ImageScrollView::viewportMouseMoveEvent(QMouseEvent* e)
@@ -65,6 +70,7 @@ void ImageScrollView::viewportMouseMoveEvent(QMouseEvent* e)
65 int mx, my; 70 int mx, my;
66 viewportToContents( e->x(), e->y(), mx, my ); 71 mx = e->x();
67 72 my = e->y();
68 scrollBy(_mouseStartPosX-mx,my-_mouseStartPosY); 73 int diffx = _mouseStartPosX-mx;
69 74 int diffy = _mouseStartPosY-my;
75 scrollBy(diffx,diffy);
70 _mouseStartPosX=mx; 76 _mouseStartPosX=mx;
@@ -75,3 +81,4 @@ void ImageScrollView::contentsMouseReleaseEvent ( QMouseEvent * e)
75{ 81{
76 viewportToContents( e->x(), e->y(), _mouseStartPosX,_mouseStartPosY ); 82 _mouseStartPosX = e->x();
83 _mouseStartPosY = e->y();
77} 84}
@@ -80,3 +87,4 @@ void ImageScrollView::contentsMousePressEvent ( QMouseEvent * e)
80{ 87{
81 viewportToContents( e->x(), e->y(), _mouseStartPosX,_mouseStartPosY ); 88 _mouseStartPosX = e->x();
89 _mouseStartPosY = e->y();
82} 90}
diff --git a/noncore/graphics/opie-eye/gui/imagescrollview.h b/noncore/graphics/opie-eye/gui/imagescrollview.h
index 5836c8d..edea235 100644
--- a/noncore/graphics/opie-eye/gui/imagescrollview.h
+++ b/noncore/graphics/opie-eye/gui/imagescrollview.h
@@ -1,3 +1,3 @@
1#ifndef __IMAGE_SCROLL_VIEW_H 1#ifndef _IMAGE_SCROLL_VIEW_H
2#define __IMAGE_SCROLL_VIEW_H 2#define _IMAGE_SCROLL_VIEW_H
3 3