From e170531dbac39c338bd9e17b5297f2e334b7e7fa Mon Sep 17 00:00:00 2001 From: kashi1998 Date: Wed, 24 Apr 2024 07:57:49 +0530 Subject: [PATCH 1/3] Changes in design --- src/Connector.js | 5 +++-- src/DragResizeBlock.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Connector.js b/src/Connector.js index d15cece..06e70bc 100644 --- a/src/Connector.js +++ b/src/Connector.js @@ -108,9 +108,10 @@ export class Connector extends Component { top: y, width: size, height: size, - borderWidth: 2, + borderWidth: 1, borderColor: 'black', - backgroundColor: 'white' + backgroundColor: 'white', + borderRadius: 100, }} {...this._panResponder.panHandlers} /> diff --git a/src/DragResizeBlock.js b/src/DragResizeBlock.js index fc84349..1682e5f 100644 --- a/src/DragResizeBlock.js +++ b/src/DragResizeBlock.js @@ -734,8 +734,8 @@ DragResizeBlock.defaultProps = { minH: 50, axis: AXIS_ALL, limitation: { - x: 0, - y: 0, + x: -250, + y: -250, w: Dimensions.get('window').width, h: Dimensions.get('window').height, }, From 56dbf99266f070fd043c44c9d2aa9b3cb2b5108e Mon Sep 17 00:00:00 2001 From: kashi1998 Date: Wed, 24 Apr 2024 08:16:33 +0530 Subject: [PATCH 2/3] changes done --- src/DragResizeBlock.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DragResizeBlock.js b/src/DragResizeBlock.js index 1682e5f..fc84349 100644 --- a/src/DragResizeBlock.js +++ b/src/DragResizeBlock.js @@ -734,8 +734,8 @@ DragResizeBlock.defaultProps = { minH: 50, axis: AXIS_ALL, limitation: { - x: -250, - y: -250, + x: 0, + y: 0, w: Dimensions.get('window').width, h: Dimensions.get('window').height, }, From 2cdf7b2bcba7935cbb6da7c5cc9c2d23a6a74dc3 Mon Sep 17 00:00:00 2001 From: kashi1998 Date: Wed, 24 Apr 2024 08:36:15 +0530 Subject: [PATCH 3/3] Drag resize size changes --- src/DragResizeBlock.js | 70 ++++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/src/DragResizeBlock.js b/src/DragResizeBlock.js index fc84349..12c0c36 100644 --- a/src/DragResizeBlock.js +++ b/src/DragResizeBlock.js @@ -41,6 +41,7 @@ export class DragResizeBlock extends Component { h, minW, minH, + visiable, } = props; this.state = { @@ -556,6 +557,8 @@ export class DragResizeBlock extends Component { onResizeEnd([ this.state.x, this.state.y, + this.state.w, + this.state.h, ]); } } @@ -683,6 +686,7 @@ export class DragResizeBlock extends Component { children, isDisabled, zIndex, + visiable } = this.props; const { @@ -693,39 +697,45 @@ export class DragResizeBlock extends Component { isSelected, } = this.state; - return ( - - - - {children} - - - - {isDisabled ? null : this.renderConnectors()} - - - ); + + {children} + + + + {isDisabled ? null : this.renderConnectors()} + + + ); + } + else { + return null; + } } } DragResizeBlock.defaultProps = { + visiable: true, x: 0, y: 0, w: 100, @@ -734,8 +744,8 @@ DragResizeBlock.defaultProps = { minH: 50, axis: AXIS_ALL, limitation: { - x: 0, - y: 0, + x: -250, + y: -250, w: Dimensions.get('window').width, h: Dimensions.get('window').height, }, @@ -795,4 +805,4 @@ DragResizeBlock.propTypes = { onResizeStart: PropTypes.func, onResize: PropTypes.func, onResizeEnd: PropTypes.func, -}; +}; \ No newline at end of file