Changeset View
Changeset View
Standalone View
Standalone View
tools/selection/image/kpToolEllipticalSelection.cpp
Show All 19 Lines | 2 | /* | |||
---|---|---|---|---|---|
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
22 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 22 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
23 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
25 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | 26 | */ | ||
27 | 27 | | |||
28 | #define DEBUG_KP_TOOL_ELLIPTICAL_SELECTION 0 | | |||
29 | | ||||
30 | | ||||
31 | #include "kpToolEllipticalSelection.h" | 28 | #include "kpToolEllipticalSelection.h" | ||
32 | 29 | | |||
33 | #include "kpLogCategories.h" | 30 | #include "kpLogCategories.h" | ||
34 | #include "document/kpDocument.h" | 31 | #include "document/kpDocument.h" | ||
35 | #include "layers/selections/image/kpEllipticalImageSelection.h" | 32 | #include "layers/selections/image/kpEllipticalImageSelection.h" | ||
36 | #include "environments/tools/selection/kpToolSelectionEnvironment.h" | 33 | #include "environments/tools/selection/kpToolSelectionEnvironment.h" | ||
37 | 34 | | |||
38 | #include <KLocalizedString> | 35 | #include <KLocalizedString> | ||
Show All 17 Lines | |||||
56 | bool kpToolEllipticalSelection::drawCreateMoreSelectionAndUpdateStatusBar ( | 53 | bool kpToolEllipticalSelection::drawCreateMoreSelectionAndUpdateStatusBar ( | ||
57 | bool dragAccepted, | 54 | bool dragAccepted, | ||
58 | const QPoint &accidentalDragAdjustedPoint, | 55 | const QPoint &accidentalDragAdjustedPoint, | ||
59 | const QRect &normalizedRect) | 56 | const QRect &normalizedRect) | ||
60 | { | 57 | { | ||
61 | // Prevent unintentional creation of 1-pixel selections. | 58 | // Prevent unintentional creation of 1-pixel selections. | ||
62 | if (!dragAccepted && accidentalDragAdjustedPoint == startPoint ()) | 59 | if (!dragAccepted && accidentalDragAdjustedPoint == startPoint ()) | ||
63 | { | 60 | { | ||
64 | #if DEBUG_KP_TOOL_ELLIPTICAL_SELECTION && 1 | | |||
65 | qCDebug(kpLogTools) << "\tnon-text NOP - return"; | 61 | qCDebug(kpLogTools) << "\tnon-text NOP - return"; | ||
66 | #endif | | |||
67 | setUserShapePoints (accidentalDragAdjustedPoint); | 62 | setUserShapePoints (accidentalDragAdjustedPoint); | ||
68 | return false; | 63 | return false; | ||
69 | } | 64 | } | ||
70 | 65 | | |||
71 | Q_ASSERT (accidentalDragAdjustedPoint == currentPoint ()); | 66 | Q_ASSERT (accidentalDragAdjustedPoint == currentPoint ()); | ||
72 | 67 | | |||
73 | document ()->setSelection ( | 68 | document ()->setSelection ( | ||
74 | kpEllipticalImageSelection ( | 69 | kpEllipticalImageSelection ( | ||
75 | normalizedRect, | 70 | normalizedRect, | ||
76 | environ ()->imageSelectionTransparency ())); | 71 | environ ()->imageSelectionTransparency ())); | ||
77 | 72 | | |||
78 | setUserShapePoints (startPoint (), currentPoint ()); | 73 | setUserShapePoints (startPoint (), currentPoint ()); | ||
79 | 74 | | |||
80 | return true; | 75 | return true; | ||
81 | } | 76 | } |