From b0ceb8843ebe9ee3054faa98f08bd255df955aa3 Mon Sep 17 00:00:00 2001 From: alwin Date: Mon, 05 Apr 2004 00:09:04 +0000 Subject: ok, found the problem with moving the image via pen/mouse --- (limited to 'noncore') 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 @@ -1,5 +1,9 @@ #include "imagescrollview.h" +#include + +using namespace Opie::Core; + #include #include @@ -10,7 +14,7 @@ ImageScrollView::ImageScrollView (const QImage&img, QWidget * parent, const char } ImageScrollView::ImageScrollView (const QString&img, QWidget * parent, const char * name, WFlags f) - :QScrollView(parent,name,f/*|Qt::WRepaintNoErase*/),_image_data(img) + :QScrollView(parent,name,f|Qt::WRepaintNoErase),_image_data(img) { init(); } @@ -60,25 +64,29 @@ void ImageScrollView::drawContents(QPainter * p, int clipx, int clipy, int clipw p->drawImage(clipx,clipy,_image_data,x,y,w,h); } +/* using the real geometry points and not the translated points is wanted! */ void ImageScrollView::viewportMouseMoveEvent(QMouseEvent* e) { int mx, my; - viewportToContents( e->x(), e->y(), mx, my ); - - scrollBy(_mouseStartPosX-mx,my-_mouseStartPosY); - + mx = e->x(); + my = e->y(); + int diffx = _mouseStartPosX-mx; + int diffy = _mouseStartPosY-my; + scrollBy(diffx,diffy); _mouseStartPosX=mx; _mouseStartPosY=my; } void ImageScrollView::contentsMouseReleaseEvent ( QMouseEvent * e) { - viewportToContents( e->x(), e->y(), _mouseStartPosX,_mouseStartPosY ); + _mouseStartPosX = e->x(); + _mouseStartPosY = e->y(); } void ImageScrollView::contentsMousePressEvent ( QMouseEvent * e) { - viewportToContents( e->x(), e->y(), _mouseStartPosX,_mouseStartPosY ); + _mouseStartPosX = e->x(); + _mouseStartPosY = e->y(); } /* for testing */ 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,5 +1,5 @@ -#ifndef __IMAGE_SCROLL_VIEW_H -#define __IMAGE_SCROLL_VIEW_H +#ifndef _IMAGE_SCROLL_VIEW_H +#define _IMAGE_SCROLL_VIEW_H #include #include -- cgit v0.9.0.2