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

List:       kde-commits
Subject:    koffice/krita/core/tiles
From:       Adrian Page <adrian () pagenet ! plus ! com>
Date:       2006-03-18 12:32:23
Message-ID: 1142685143.833413.3324.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 519950 by page:

Tiles that exist at the start of a transaction and are then deleted and recreated \
should not be deleted on undo. This fixes the transform tool undo.


 M  +15 -0     kis_memento.cc  
 M  +2 -0      kis_memento.h  
 M  +1 -1      kis_tileddatamanager.cc  


--- trunk/koffice/krita/core/tiles/kis_memento.cc #519949:519950
@@ -136,4 +136,19 @@
     return QRect(x, y, w, h);
 }
 
+bool KisMemento::containsTile(Q_INT32 col, Q_INT32 row, Q_UINT32 tileHash) const
+{
+    const KisTile *tile = m_hashTable[tileHash];
 
+    while (tile != 0)
+    {
+        if (tile->getRow() == row && tile->getCol() == col) {
+            return true;
+        }
+
+        tile = tile->getNext();
+    }
+
+    return false;
+}
+
--- trunk/koffice/krita/core/tiles/kis_memento.h #519949:519950
@@ -45,6 +45,8 @@
     void extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const;
     QRect extent() const;
 
+    bool containsTile(Q_INT32 col, Q_INT32 row, Q_UINT32 tileHash) const;
+
     // For debugging use
     bool valid() const { return m_valid; }
     void setInvalid() { m_valid = false; }
--- trunk/koffice/krita/core/tiles/kis_tileddatamanager.cc #519949:519950
@@ -782,7 +782,7 @@
             m_numTiles++;
             updateExtent(col, row);
 
-            if (m_currentMemento) {
+            if (m_currentMemento && !m_currentMemento->containsTile(col, row, \
tileHash)) {  m_currentMemento->addTileToDeleteOnUndo(col, row);
             }
         }


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

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