We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
KnobVisualHelpers uses vbox.width to calculate centerY and it offsets the graphic of the helper for non-square knobs.
Change from:
static getDerivedStateFromProps(props: KnobVisualHelpersProps, state: KnobVisualHelpersState) { //Calculate position const vbox = props.svgRef.getBoundingClientRect(); const halfWidth = vbox.width / 2; //Calculate current angle segment end point //Note: Not sure why we need to substract 90 here const valueMarkerX = props.radius * Math.cos(utils.toRadians(props.valueAngle - 90)); const valueMarkerY = props.radius * Math.sin(utils.toRadians(props.valueAngle - 90)); return { ...state, centerX: vbox.left + halfWidth, centerY: vbox.top + halfWidth, valueMarkerX, valueMarkerY }; }
to:
static getDerivedStateFromProps(props: KnobVisualHelpersProps, state: KnobVisualHelpersState) { //Calculate position const vbox = props.svgRef.getBoundingClientRect(); const halfWidth = vbox.width / 2; const halfHeight = vbox.height / 2; //Calculate current angle segment end point //Note: Not sure why we need to substract 90 here const valueMarkerX = props.radius * Math.cos(utils.toRadians(props.valueAngle - 90)); const valueMarkerY = props.radius * Math.sin(utils.toRadians(props.valueAngle - 90)); return { ...state, centerX: vbox.left + halfWidth, centerY: vbox.top + halfHeight, valueMarkerX, valueMarkerY }; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
KnobVisualHelpers uses vbox.width to calculate centerY and it offsets the graphic of the helper for non-square knobs.
Change from:
to:
The text was updated successfully, but these errors were encountered: