Skip to content

Commit cff0f45

Browse files
committed
add option to overwwrite position
1 parent 04060c4 commit cff0f45

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

hocs/withProjectedPosition.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const roundPoint = ({ x, y, z }, precision) => ({
1111
z: round(z, precision),
1212
});
1313

14-
export default ({ throttleMs = 33 } = {}) => C =>
14+
export default ({ throttleMs = 33, overwritePosition = {} } = {}) => C =>
1515
withAnimationFrame(
1616
class extends Component {
1717
projectionRunning = true;
@@ -91,7 +91,10 @@ export default ({ throttleMs = 33 } = {}) => C =>
9191
render() {
9292
return (
9393
<C
94-
positionProjected={this.state.positionProjected}
94+
positionProjected={{
95+
...this.state.positionProjected,
96+
...overwritePosition,
97+
}}
9598
projectionResult={this.state.projectionResult}
9699
{...this.props}
97100
/>

0 commit comments

Comments
 (0)