Git Product home page Git Product logo

react-native-pinch-zoom-view's People

Contributors

3djakob avatar francisco-sanchez-molina avatar guochen-whu avatar hissvard avatar nguyenvanphuc2203 avatar timurkhab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

react-native-pinch-zoom-view's Issues

Readme.md

The documentation needs updating. The command to download/install from npm,

npm install react-native-pinch-zoom --save, doesn't work.

The following does:
npm install react-native-pinch-zoom-view --save.

Just a friendly heads up! Stay awesome!

Won't allow to move view around if part of the view is not in the initial phone frame

I currently have a view that is bigger than my phone screen and when I try to translate the view, I'm only able to translate it with the portions of the view that is on initial start up. Here's a picture to what I'm referring to:
view

The shaded red portion is the only area in which I can translate and zoom in, but I can not zoom in or translate on the red portions that are not shaded

Zoom disable doesn't work

I set scalable={false} as prop of PinchZoomView component - but it still zooming regardless value

"react": "16.0.0",
"react-native": "0.51.0"
"react-native-pinch-zoom-view": "^0.1.3"

Reset scroll position/zoom

Thanks for the library, seems to work well.

I am seeing that if I use PinchZoomView, change to a different view, and come back the PinchZoomView keeps its zoom/scroll position. Is there a way to reset the position to the default?

feature request: animated zoom reset

Great tool!

I would love to be able to animate the zoom back to its originally rendered scale & position. I imagine it'd be pretty easy to add this as a method but I'm pretty new to React so I'm posting here in case anyone else wants to try. I might take a crack at it in the next couple months if not. :)

Limit translate

Possible to not let translate out of margins, limit in some way to not go over width and height. I will try to explain with an image.

image

*phone width

Click not working while zooming more than 1.5X

Hi,
Library is so helpful.

Components description:I've an Image and Rect(of SVG) inside PinchZoomView tag.
Issue: on press is not working while we are zooming the image for more than 1.5X or 2X. Is there a possibility of restricting the scale of zoom to a particular value. because click on working and moreover screen is flickering instead of getting selected.

thanks in advance :)

Not working!

I am wrapping an image in pinch-zoom-view... Nothing is happening!

Could not find a declaration file for module "react-native-ping-zoom-view"

Could not find a declaration file for module "react-native-pinch-zoom-view". 'c:/Users/User/project/node_modules/react-native-pinch-zoom-view/index'
I try "npm install @types/react-native-pinch-zoom-view" - not working.
I try create file index.d.ts with "declare module 'react-native-pinch-zoom-view';" Error is gone, but <PinchZoomView><SvgXml bla-bla-bla /></PinchZoomView> - not zoomable.
[email protected]
Expo sdk 35
react 16.8.3

Zooming causes objects to move off screen

I'm having an issue where, for large canvases, zooming changes the apparent pan location. In fact, offsetX stays 0 which the PinchZoomView has become smaller, and converges onto its center:
In this example the PinchZoomView has a width and height of 2500. The objects in the view are about 200x400.

panzoom

I'm working on a fix which would require the user to supply height/width of the PinchZoomView as props, then update the OffsetX using the width, OffsetX, and current scale in the equation, but this equation is difficult to think about.

I think the component would be improved if the objects being zoomed in on stay in focus when zooming.

I think this line need a little fix

_handleMoveShouldSetPanResponder = (e, gestureState) => {
    return this.props.scalable && gestureState.dx > 2 || gestureState.dy > 2 || gestureState.numberActiveTouches === 2;
}

should be

_handleMoveShouldSetPanResponder = (e, gestureState) => {
    return this.props.scalable && (gestureState.dx > 2 || gestureState.dy > 2 || gestureState.numberActiveTouches === 2);
}

Zoom doesn't work when inside a Modal

First of all, thanks for this awesome lib! It was the first I found that truly uses only RN, and I searched a lot...

So now for the issue, I need zoom for an image inside a Modal and that doesnt seem to work. ๐Ÿ˜ญ

I have tested it outside and had no problems whatsoever, but <PinchZoomView> wont zoom if inside <Modal> tags.

Solve Invariant Violation error by switching to deprecated-react-native-prop-types version of ViewPropTypes

Hi! ๐Ÿ‘‹

Firstly, thanks for your work on this project! ๐Ÿ™‚

Today I used patch-package to patch [email protected] for the project I'm working on.

I was getting an Invariant Violation error.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-pinch-zoom-view/index.js b/node_modules/react-native-pinch-zoom-view/index.js
index da7d6c4..d98595c 100644
--- a/node_modules/react-native-pinch-zoom-view/index.js
+++ b/node_modules/react-native-pinch-zoom-view/index.js
@@ -1,6 +1,7 @@
 import React, { Component } from 'react';
 import PropTypes from 'prop-types';
-import { View, StyleSheet, PanResponder, ViewPropTypes } from 'react-native';
+import { View, StyleSheet, PanResponder } from 'react-native';
+import ViewPropTypes from 'deprecated-react-native-prop-types';
 
 // Fallback when RN version is < 0.44
 const viewPropTypes = ViewPropTypes || View.propTypes;

This issue body was partially generated by patch-package.

How to Fix the ZoomOut Value

Hi Guys

Am facing an issue with zoom out.How can I fix the zoom out value in react-native-pinch-zoom-view.
I tried many but I couldn't figure it out.Could you please help me, guys.It's going zoom out too much.How can i handle this.
Actually am zooming the View not an image.In View am displaying html Content through then react-native-render-html plugin.It contains image or content(text).

simulator screen shot - iphone 6s - 2018-03-06 at 16 34 23

componentWillMount warning

Great library.
Just to let you know that it now raises a warning regarding react lifecycle method componentWillMount. It is being deprecated.

Zoom to particular location using tap

Is it possible to zoom to a particular point location within view without using pinch gesture and later pinch can be used to zoom out of the state...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.