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

List:       kde-commits
Subject:    koffice/krita/tools
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2004-08-30 12:20:06
Message-ID: 20040830122006.0BE4890B5 () office ! kde ! org
[Download RAW message or body]

CVS commit by rempt: 

* Fix bug http://bugs.kde.org/show_bug.cgi?id=86811 
* Some work on selections tools.
* Removed unused declarations of tile classes


  M +6 -2      kis_tool_fill.cc   1.49
  M +0 -1      kis_tool_fill.h   1.27
  M +1 -2      kis_tool_freehand.cc   1.9
  M +18 -0     kis_tool_select_brush.cc   1.11
  M +1 -0      kis_tool_select_brush.h   1.7
  M +3 -2      kis_tool_select_contiguous.cc   1.21
  M +4 -0      kis_tool_select_contiguous.h   1.10
  M +2 -0      kis_tool_select_freehand.h   1.14


--- koffice/krita/tools/kis_tool_fill.cc  #1.48:1.49
@@ -109,6 +109,10 @@ void KisToolFill::buttonPress(KisButtonP
         if (!m_currentImage || !m_currentImage -> activeDevice()) return;
         if (e->button() != QMouseEvent::LeftButton) return;
-        
-        flood(e -> pos().floorX(), e -> pos().floorY());
+        int x, y;
+        x = e -> pos().floorX();
+        y= e -> pos().floorY();
+        if (x >= m_currentImage -> activeDevice() -> width() || x < 0) return;
+        if (y >= m_currentImage -> activeDevice() -> height() || y < 0) return;
+        flood(x, y);
         notifyModified();
 }

--- koffice/krita/tools/kis_tool_fill.h  #1.26:1.27
@@ -64,5 +64,4 @@ public slots:
 private:
         int m_threshold;
-        KisTileCommand* m_ktc;
         Q_INT32 m_depth;
         KisLayerSP m_lay;

--- koffice/krita/tools/kis_tool_freehand.cc  #1.8:1.9
@@ -146,6 +146,5 @@ void KisToolFreeHand::endPaint() 
 {
         m_mode = HOVER;
-        KisPaintDeviceSP device;
-        if (m_currentImage && (device = m_currentImage -> activeDevice())) {
+        if (m_currentImage) { 
                 KisUndoAdapter *adapter = m_currentImage -> undoAdapter();
                 if (adapter && m_painter) {

--- koffice/krita/tools/kis_tool_select_brush.cc  #1.10:1.11
@@ -86,4 +86,22 @@ void KisToolSelectBrush::initPaint(KisEv
 }
 
+void KisToolSelectBrush::endPaint() 
+{
+        m_mode = HOVER;
+        KisSelectionSP selection;
+        if (m_currentImage && (selection = m_currentImage -> activeLayer() -> selection())) {
+                KisUndoAdapter *adapter = m_currentImage -> undoAdapter();
+                if (adapter && m_painter) {
+                        // If painting in mouse release, make sure painter
+                        // is destructed or end()ed
+                        adapter -> addCommand(m_painter->endTransaction());
+                }
+                delete m_painter;
+                m_painter = 0;
+                notifyModified();
+        }
+}
+
+
 void KisToolSelectBrush::setup(KActionCollection *collection)
 {

--- koffice/krita/tools/kis_tool_select_brush.h  #1.6:1.7
@@ -46,4 +46,5 @@ protected:
 
         virtual void initPaint(KisEvent *e);
+        virtual void endPaint();
 };
 #endif // KIS_TOOL_SELECT_BRUSH_H_

--- koffice/krita/tools/kis_tool_select_contiguous.cc  #1.20:1.21
@@ -43,5 +43,6 @@ KisToolSelectContiguous::KisToolSelectCo
         m_dragStart = QPoint(-1,-1);
         m_dragEnd = QPoint(-1,-1);
-        setCursor(KisCursor::brushCursor());
+        //XXX : make wizard cursor from tool icon.
+        setCursor(KisCursor::arrowCursor());
 }
 
@@ -178,5 +179,5 @@ void KisToolSelectContiguous::setup(KAct
         if (m_action == 0) {
                 m_action = new KRadioAction(i18n("Tool &Contiguous Select"), 
-                                            "contiguous" , 
+                                            "wizard" , 
                                             0, 
                                             this, 

--- koffice/krita/tools/kis_tool_select_contiguous.h  #1.9:1.10
@@ -27,4 +27,8 @@
 #include "kis_tool_non_paint.h"
 
+/**
+ * The 'magic wand' selection tool -- in fact just 
+ * a floodfill that only creates a selection.
+ */
 class KisToolSelectContiguous : public KisToolNonPaint {
 

--- koffice/krita/tools/kis_tool_select_freehand.h  #1.13:1.14
@@ -30,4 +30,6 @@
 #include "kis_tool_non_paint.h"
 
+// This is KisToolSelectBrush, but filled when the mouse 
+// button is released.
 class KisToolSelectFreehand : public KisToolNonPaint {
 


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

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