Skip to content

Commit 42f4481

Browse files
committed
Added initialScale prop
Sets the initial scale to be used, and allow cover mode to work in react-native-transformable-image ldn0x7dc/react-native-transformable-image#11
1 parent 6aeb862 commit 42f4481

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

library/transform/ViewTransformer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ export default class ViewTransformer extends React.Component {
1919

2020
constructor(props) {
2121
super(props);
22+
2223
this.state = {
2324
//transform state
24-
scale: 1,
25+
scale: props.initialScale,
2526
translateX: 0,
2627
translateY: 0,
2728

@@ -507,6 +508,7 @@ ViewTransformer.propTypes = {
507508
*/
508509
maxOverScrollDistance: React.PropTypes.number,
509510

511+
initialScale: React.PropTypes.number,
510512
maxScale: React.PropTypes.number,
511513
contentAspectRatio: React.PropTypes.number,
512514

@@ -525,6 +527,7 @@ ViewTransformer.defaultProps = {
525527
enableScale: true,
526528
enableTranslate: true,
527529
enableTransform: true,
530+
initialScale: 1,
528531
maxScale: 1,
529532
enableResistance: false,
530533
enableLimits: false,

0 commit comments

Comments
 (0)