From 3ab1067c65555163a071e2ea4aa5f72142d6bbc5 Mon Sep 17 00:00:00 2001 From: DD Date: Thu, 25 Jan 2018 11:33:43 -0500 Subject: [PATCH 1/4] flip all --- src/components/mode-tools/mode-tools.jsx | 2 -- src/containers/mode-tools.jsx | 12 +++++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/mode-tools/mode-tools.jsx b/src/components/mode-tools/mode-tools.jsx index a9522aa1..e2b9b3ec 100644 --- a/src/components/mode-tools/mode-tools.jsx +++ b/src/components/mode-tools/mode-tools.jsx @@ -151,13 +151,11 @@ const ModeToolsComponent = props => { Date: Thu, 25 Jan 2018 18:32:43 -0500 Subject: [PATCH 2/4] Don't enable if there is nothing in the editor --- src/components/mode-tools/mode-tools.jsx | 3 +++ src/containers/mode-tools.jsx | 8 +++++++- src/helper/selection.js | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/mode-tools/mode-tools.jsx b/src/components/mode-tools/mode-tools.jsx index e2b9b3ec..2cde3d3c 100644 --- a/src/components/mode-tools/mode-tools.jsx +++ b/src/components/mode-tools/mode-tools.jsx @@ -151,11 +151,13 @@ const ModeToolsComponent = props => { 0; } + hasItems () { + return getAllSelectableRootItems().length > 0; + } handleCurvePoints () { let changed; const points = this._getSelectedUncurvedPoints(); @@ -203,6 +208,7 @@ class ModeTools extends React.Component { render () { return ( Date: Fri, 26 Jan 2018 17:21:47 -0500 Subject: [PATCH 3/4] Revert "Don't enable if there is nothing in the editor" This reverts commit e4ca0482b8a8f097930f858e81b9b8a902f21cdf. --- src/components/mode-tools/mode-tools.jsx | 3 --- src/containers/mode-tools.jsx | 8 +------- src/helper/selection.js | 1 - 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/components/mode-tools/mode-tools.jsx b/src/components/mode-tools/mode-tools.jsx index 2cde3d3c..e2b9b3ec 100644 --- a/src/components/mode-tools/mode-tools.jsx +++ b/src/components/mode-tools/mode-tools.jsx @@ -151,13 +151,11 @@ const ModeToolsComponent = props => { 0; } - hasItems () { - return getAllSelectableRootItems().length > 0; - } handleCurvePoints () { let changed; const points = this._getSelectedUncurvedPoints(); @@ -208,7 +203,6 @@ class ModeTools extends React.Component { render () { return ( Date: Mon, 29 Jan 2018 15:03:05 -0500 Subject: [PATCH 4/4] Remove special case flip around center when nothing is selected --- src/containers/mode-tools.jsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/containers/mode-tools.jsx b/src/containers/mode-tools.jsx index 1f2530d0..00205ffa 100644 --- a/src/containers/mode-tools.jsx +++ b/src/containers/mode-tools.jsx @@ -138,11 +138,9 @@ class ModeTools extends React.Component { } _handleFlip (horizontalScale, verticalScale) { let selectedItems = getSelectedRootItems(); - let center; if (selectedItems.length === 0) { - // If nothing is selected, flip everything over the rotation point + // If nothing is selected, select everything selectedItems = getAllRootItems(); - center = paper.view.center; } // Record old indices for (const item of selectedItems) { @@ -152,7 +150,7 @@ class ModeTools extends React.Component { // Group items so that they flip as a unit const itemGroup = new paper.Group(selectedItems); // Flip - itemGroup.scale(horizontalScale, verticalScale, center); + itemGroup.scale(horizontalScale, verticalScale); ensureClockwise(itemGroup); // Remove flipped item from group and insert at old index. Must insert from bottom index up.