Diffstat (limited to 'noncore/graphics/opie-eye/lib') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/lib/oimagezoomer.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/noncore/graphics/opie-eye/lib/oimagezoomer.cpp b/noncore/graphics/opie-eye/lib/oimagezoomer.cpp index 178fbd4..ffa3c0c 100644 --- a/noncore/graphics/opie-eye/lib/oimagezoomer.cpp +++ b/noncore/graphics/opie-eye/lib/oimagezoomer.cpp | |||
@@ -26,6 +26,10 @@ OImageZoomer::OImageZoomer( const QSize& pSize, const QSize& vSize, QWidget* par | |||
26 | init(); | 26 | init(); |
27 | } | 27 | } |
28 | 28 | ||
29 | OImageZoomer::~OImageZoomer() { | ||
30 | |||
31 | } | ||
32 | |||
29 | void OImageZoomer::init() { | 33 | void OImageZoomer::init() { |
30 | setFrameStyle( Panel | Sunken ); | 34 | setFrameStyle( Panel | Sunken ); |
31 | } | 35 | } |
@@ -93,7 +97,7 @@ void OImageZoomer::drawContents( QPainter* p ) { | |||
93 | } | 97 | } |
94 | 98 | ||
95 | void OImageZoomer::mousePressEvent( QMouseEvent* ) { | 99 | void OImageZoomer::mousePressEvent( QMouseEvent* ) { |
96 | 100 | m_mouseX = m_mouseY = -1; | |
97 | } | 101 | } |
98 | 102 | ||
99 | void OImageZoomer::mouseMoveEvent( QMouseEvent* ev ) { | 103 | void OImageZoomer::mouseMoveEvent( QMouseEvent* ev ) { |
@@ -102,10 +106,10 @@ void OImageZoomer::mouseMoveEvent( QMouseEvent* ev ) { | |||
102 | my = ev->y(); | 106 | my = ev->y(); |
103 | 107 | ||
104 | if ( m_mouseX != -1 && m_mouseY != -1 ) { | 108 | if ( m_mouseX != -1 && m_mouseY != -1 ) { |
105 | int diffx = m_mouseX-mx; | 109 | int diffx = ( mx - m_mouseX ) * m_imgSize.width() / width(); |
106 | int diffy = m_mouseY-my; | 110 | int diffy = ( my - m_mouseY ) * m_imgSize.height() / height(); |
107 | // emit zoomAreaRel( diffx, diffy ); | 111 | emit zoomAreaRel( diffx, diffy ); |
108 | // emit zoomArea( | 112 | emit zoomArea(m_visPt.x()+diffx, m_visPt.y()+diffy ); |
109 | } | 113 | } |
110 | m_mouseX = mx; | 114 | m_mouseX = mx; |
111 | m_mouseY = my; | 115 | m_mouseY = my; |