From a6e7fb42516067d6045df9128e8a42630b5dbf75 Mon Sep 17 00:00:00 2001 From: DD Date: Mon, 9 Apr 2018 20:10:53 -0400 Subject: [PATCH] update button state when undoing between modes, hide vector tools --- src/components/paint-editor/paint-editor.css | 4 +++ src/components/paint-editor/paint-editor.jsx | 5 +-- src/containers/paint-editor.jsx | 16 +++++----- src/containers/paper-canvas.jsx | 14 +++++---- src/helper/undo.js | 33 ++++++++++++++++---- src/lib/format.js | 19 +++++++++-- src/reducers/format.js | 5 +++ src/reducers/undo.js | 22 ++++++++++--- test/unit/format-reducer.test.js | 11 +++++++ 9 files changed, 100 insertions(+), 29 deletions(-) diff --git a/src/components/paint-editor/paint-editor.css b/src/components/paint-editor/paint-editor.css index 087c1e82..f5500253 100644 --- a/src/components/paint-editor/paint-editor.css +++ b/src/components/paint-editor/paint-editor.css @@ -150,6 +150,10 @@ $border-radius: 0.25rem; justify-content: space-between; } +.hidden { + display: none; +} + .zoom-controls { display: flex; flex-direction: row-reverse; diff --git a/src/components/paint-editor/paint-editor.jsx b/src/components/paint-editor/paint-editor.jsx index ed373319..771bf79e 100644 --- a/src/components/paint-editor/paint-editor.jsx +++ b/src/components/paint-editor/paint-editor.jsx @@ -35,6 +35,7 @@ import StrokeWidthIndicatorComponent from '../../containers/stroke-width-indicat import TextMode from '../../containers/text-mode.jsx'; import Formats from '../../lib/format'; +import {isVector} from '../../lib/format'; import layout from '../../lib/layout-constants'; import styles from './paint-editor.css'; @@ -342,7 +343,7 @@ const PaintEditorComponent = props => {
{/* Modes */} {props.canvas !== null ? ( // eslint-disable-line no-negated-condition -
+
@@ -408,7 +409,7 @@ const PaintEditorComponent = props => { }
- {props.format === Formats.VECTOR ? + {isVector(props.format) ?