Skip to content

Commit

Permalink
Added initialScale prop
Browse files Browse the repository at this point in the history
Sets the initial scale to be used, and allow cover mode to work in
react-native-transformable-image

ldn0x7dc/react-native-transformable-image#11
  • Loading branch information
maraujop committed Aug 31, 2016
1 parent 6aeb862 commit 42f4481
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion library/transform/ViewTransformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ export default class ViewTransformer extends React.Component {

constructor(props) {
super(props);

this.state = {
//transform state
scale: 1,
scale: props.initialScale,
translateX: 0,
translateY: 0,

Expand Down Expand Up @@ -507,6 +508,7 @@ ViewTransformer.propTypes = {
*/
maxOverScrollDistance: React.PropTypes.number,

initialScale: React.PropTypes.number,
maxScale: React.PropTypes.number,
contentAspectRatio: React.PropTypes.number,

Expand All @@ -525,6 +527,7 @@ ViewTransformer.defaultProps = {
enableScale: true,
enableTranslate: true,
enableTransform: true,
initialScale: 1,
maxScale: 1,
enableResistance: false,
enableLimits: false,
Expand Down

0 comments on commit 42f4481

Please sign in to comment.