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

List:       kde-commits
Subject:    KDE/kdegraphics/kolourpaint/tools/selection
From:       Clarence Dang <dang () kde ! org>
Date:       2006-11-26 7:48:04
Message-ID: 1164527284.336028.11581.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 607891 by dang:

Q_ASSERT() the fact that kpToolSelection::create() ensures \
"accidentalDragAdjustedPoint == currentPoint()" unless it's the text tool and \
"!m_hadSelectionBeforeDrag"


 M  +4 -1      kptoolellipticalselection.cpp  
 M  +4 -2      kptoolfreeformselection.cpp  
 M  +3 -1      kptoolrectselection.cpp  


--- trunk/KDE/kdegraphics/kolourpaint/tools/selection/kptoolellipticalselection.cpp \
#607890:607891 @@ -51,12 +51,15 @@
 
 // protected virtual [base kpToolSelection]
 void kpToolEllipticalSelection::createMoreSelectionAndUpdateStatusBar (
-        const QPoint &/*accidentalDragAdjustedPoint*/,
+        const QPoint &accidentalDragAdjustedPoint,
         const QRect &normalizedRect)
 {
+    Q_ASSERT (accidentalDragAdjustedPoint == currentPoint ());
+    
     document ()->setSelection (
         kpSelection (
             kpSelection::Ellipse, normalizedRect,
             mainWindow ()->selectionTransparency ()));
+        
     setUserShapePoints (startPoint (), currentPoint ());
 }
--- trunk/KDE/kdegraphics/kolourpaint/tools/selection/kptoolfreeformselection.cpp \
#607890:607891 @@ -57,10 +57,12 @@
         const QPoint &accidentalDragAdjustedPoint,
         const QRect &/*normalizedRect*/)
 {
-    QPolygon points;
+    Q_ASSERT (accidentalDragAdjustedPoint == currentPoint ());
 
     Q_ASSERT (m_dragHasBegun == (bool) document ()->selection ());
 
+    QPolygon points;
+
     // First point in drag?
     if (!m_dragHasBegun)
     {
@@ -87,5 +89,5 @@
               << endl;
 #endif
 
-    setUserShapePoints (currentPoint ());
+    setUserShapePoints (accidentalDragAdjustedPoint);
 }
--- trunk/KDE/kdegraphics/kolourpaint/tools/selection/kptoolrectselection.cpp \
#607890:607891 @@ -51,9 +51,11 @@
 
 // protected virtual [base kpToolSelection]
 void kpToolRectSelection::createMoreSelectionAndUpdateStatusBar (
-        const QPoint &/*accidentalDragAdjustedPoint*/,
+        const QPoint &accidentalDragAdjustedPoint,
         const QRect &normalizedRect)
 {
+    Q_ASSERT (accidentalDragAdjustedPoint == currentPoint ());
+
     const QRect usefulRect = normalizedRect.intersect (document ()->rect ());
     document ()->setSelection (
         kpSelection (


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

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