diff --git a/src/pages/editor/Container.tsx b/src/pages/editor/Container.tsx index e9b818a..fa5117d 100644 --- a/src/pages/editor/Container.tsx +++ b/src/pages/editor/Container.tsx @@ -11,6 +11,7 @@ import { } from '@ant-design/icons'; import { connect } from 'dva'; import HeaderComponent from './components/Header'; +import CanvasControl from './components/CanvasControl'; import SourceBox from './SourceBox'; import TargetBox from './TargetBox'; import Calibration from 'components/Calibration'; @@ -184,6 +185,7 @@ const Container = (props: { dispatch(ActionCreators.redo()); }; }, [dispatch]); + const undohandler = useMemo(() => { return () => { dispatch(ActionCreators.undo()); @@ -381,6 +383,11 @@ const Container = (props: { } }; }, []); + + const updateDrag = useCallback(() => { + setDragState({ x: 0, y: 0 }); + }, []); + const mousemovefn = useMemo(() => { return (e: React.MouseEvent) => { if (diffmove.move) { @@ -509,40 +516,12 @@ const Container = (props: { allType={allType} /> {/* TODO ζš‚ζ—Άιšθ— */} - {/*
- setDragState({ x: 0, y: 0 })} /> -
*/} - {/*
{render}
*/} -
- - + - - {scaleNum * 100}% - - - - - - - - - setDragState({ x: 0, y: 0 })} /> - -
- {/*
- -
*/} + {renderRight}
): void; + updateDrag(event: MouseEvent): void; +} + +const CanvasControl = (props: CanvasControlProps) => { + const { scaleNum, handleSlider, backSize, updateDrag } = props; + return ( +
+ + + + + {scaleNum * 100}% + + - + + + + + + + +
+ ); +}; + +export default CanvasControl; diff --git a/src/pages/editor/index.less b/src/pages/editor/index.less index 00a0af6..2137dc5 100644 --- a/src/pages/editor/index.less +++ b/src/pages/editor/index.less @@ -192,43 +192,6 @@ bottom: 380px; right: 5px; } - .sliderWrap { - position: absolute; - display: inline-block; - right: 10px; - bottom: 10px; - height: 32px; - line-height: 30px; - background: #ffffff; - box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.1); - border-radius: 4px; - color: #4a4a4a; - .slider { - position: absolute; - right: 30px; - bottom: 95px; - font-size: 14px; - } - .sliderBtn { - cursor: pointer; - user-select: none; - display: inline; - font-size: 14px; - color: #4a4a4a; - } - span { - margin: 0 8px; - } - .backSize { - cursor: pointer; - color: #4a4a4a; - &::before { - content: '|'; - color: #dbdbdb; - margin-right: 7px; - } - } - } } .attrSetting { width: 304px;