Diffstat (limited to 'noncore/graphics/opie-eye/lib/oimagezoomer.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/lib/oimagezoomer.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/noncore/graphics/opie-eye/lib/oimagezoomer.cpp b/noncore/graphics/opie-eye/lib/oimagezoomer.cpp index 4df5dcc..00b93e2 100644 --- a/noncore/graphics/opie-eye/lib/oimagezoomer.cpp +++ b/noncore/graphics/opie-eye/lib/oimagezoomer.cpp | |||
@@ -170,12 +170,21 @@ void OImageZoomer::drawContents( QPainter* p ) { | |||
170 | * rect. So image size relates to contentRect | 170 | * rect. So image size relates to contentRect |
171 | * | 171 | * |
172 | */ | 172 | */ |
173 | QRect c( contentsRect() ); | 173 | QRect c( contentsRect() ); |
174 | p->setPen( Qt::red ); | 174 | p->setPen( Qt::red ); |
175 | 175 | ||
176 | /* | ||
177 | * the contentRect is set equal to the size of the image | ||
178 | * Rect/Original = NewRectORWidth/OriginalVisibleStuff and then simply we | ||
179 | * need to add the c.y/x due usage of QFrame | ||
180 | * For x and y we use the visiblePoint | ||
181 | * For height and width we use the size of the viewport | ||
182 | * if width/height would be bigger than our widget we use this width/height | ||
183 | * | ||
184 | */ | ||
176 | int len = m_imgSize.width(); | 185 | int len = m_imgSize.width(); |
177 | int x = (c.width()*m_visPt.x())/len + c.x(); | 186 | int x = (c.width()*m_visPt.x())/len + c.x(); |
178 | int w = (c.width()*m_visSize.width() )/len + c.x(); | 187 | int w = (c.width()*m_visSize.width() )/len + c.x(); |
179 | if ( w > c.width() ) w = c.width(); | 188 | if ( w > c.width() ) w = c.width(); |
180 | 189 | ||
181 | len = m_imgSize.height(); | 190 | len = m_imgSize.height(); |