Comments (6)
Quite simple:
Remove the lines 216-219:
float scaleX = (float) viewWidth / (float) bmWidth;
float scaleY = (float) viewHeight / (float) bmHeight;
scale = Math.min(scaleX, scaleY);
matrix.setScale(scale, scale);
and put them on a new method that is called between the lines 102-103 (only the first time).
if (xDiff < CLICK && yDiff < CLICK) {
newMethod();
performClick();
}
from touchimageview.
I did that and the following lines are giving error:
float redundantYSpace = (float) viewHeight - (scale * (float) bmHeight) ;
float redundantXSpace = (float) viewWidth - (scale * (float) bmWidth);
redundantYSpace /= (float) 2 ;
redundantXSpace /= (float) 2;
from touchimageview.
I suppose that is a NullPointerException. Put before those lines:
scale = 1;
to say that it is not scaled at the begining
from touchimageview.
Setting scale = 1 solved the problem but causes a new one. The image now only appears when I touch the screen and it floats at the bottom of the screen.
from touchimageview.
I solved the problem. Instead of removing lines 216-219, I kept them and added 2 lines of code:
float scaleX = (float) viewWidth / (float) bmWidth;
float scaleY = (float) viewHeight / (float) bmHeight;
float scaleZ =1f;
scale = Math.min(scaleX, scaleY);
scale = Math.min(scale, scaleZ);
matrix.setScale(scale, scale);
from touchimageview.
This issue will be fixed when scaleTypes are supported. You could then set the scale type to "center" in xml. Closed as another open issue deals with supporting scale types.
from touchimageview.
Related Issues (20)
- Issue with scrolling for TouchImageView inside AppBarLayout / CollapsableToolbar HOT 3
- Cannot resolve class com.ortiz.touchview.TouchImageView HOT 4
- How to override double tap event? HOT 2
- Failed to resolve: com.github.MikeOrtiz:TouchImageView:3.1.1 HOT 1
- it cannot find the library HOT 1
- Dependency Version HOT 1
- IllegalArgumentException HOT 2
- Version 2.3.3 not available anymore on JitPack HOT 3
- Panning to border not possible when zoomed in on multiple TouchImageViews HOT 4
- The TouchImageView is not correctly wrapped vertically when wrap content is used. HOT 5
- I don't know how this app will work HOT 2
- Free move HOT 1
- Crashing with 3.1.1: Parameter specified as non-null is null HOT 5
- OnFling listener not working HOT 1
- adjustViewBounds = true not work HOT 1
- Feature: reset zoom when user release them finger
- Calling setZoomAnimated() twice with the same point causes a glitch HOT 1
- Incorrect zoom coordinates when calling setZoom()/setZoomAnimated() HOT 10
- Feature request: disable double tap
- Feature requested : detect swipe to bottom HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from touchimageview.