[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdemultimedia/noatun/modules/kjofol-skin
From:       Scott Wheeler <wheeler () kde ! org>
Date:       2003-04-21 12:36:43
[Download RAW message or body]

CVS commit by wheeler: 

Stefan metioned something; I went to look -- bang.  ;-)  Check to make sure
that the coordinates are valid before trying to get the pixel.


  M +7 -2      kjseeker.cpp   1.11


--- kdemultimedia/noatun/modules/kjofol-skin/kjseeker.cpp  #1.10:1.11
@@ -133,6 +133,11 @@ bool KJSeeker::mousePress(const QPoint &
 void KJSeeker::mouseRelease(const QPoint &pos, bool in)
 {
-        QRgb color=mScale.pixel(rect().topLeft().x()+pos.x(),
-                                                 rect().topLeft().y()+pos.y());
+        int x = rect().topLeft().x()+pos.x();
+        int y = rect().topLeft().y()+pos.y();
+
+        if(!mScale.valid(x, y))
+           return;
+
+        QRgb color=mScale.pixel(x, y);
 
         // user released mousebutton outside of the seeker-area (which is gray)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic