Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the break point in SteppedLine #49

Open
iagows opened this issue Mar 26, 2021 · 0 comments
Open

Change the break point in SteppedLine #49

iagows opened this issue Mar 26, 2021 · 0 comments

Comments

@iagows
Copy link

iagows commented Mar 26, 2021

There is a const x2 = (x0 + x1) / 2; and a const y2 = (y0 + y1) / 2;.
Maybe this / 2 could be an parameter (defaults to 0.5) so the user could change this to avoid overlaping with some other elements in screen.

Something like this:

const defaultPercentBreakPoint = 0.5;

...

 renderVertical() {
...
const y2 = (y0 + y1) * (percentBreak ?? this.defaultPercentBreakPoint);
...
}

renderHorizontal(){
...
const x2 = (x0 + x1) * (percentBreak ?? this.defaultPercentBreakPoint);
...
}

SteppedLine.propTypes = Object.assign({}, {
    x0: PropTypes.number.isRequired,
    y0: PropTypes.number.isRequired,
    x1: PropTypes.number.isRequired,
    y1: PropTypes.number.isRequired,
    orientation: PropTypes.oneOf(['h', 'v']),
   percentBreak: PropTypes.number,
}, optionalStyleProps);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant