You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using setScale and setPosition seems to work initially (imageview shows image at specified scale and position), but any touch interaction results in imageview immediately reverting to default position and scale.
After much mucking about with setScale and setPosition it seems the problem lays in the touch listener not being set to match the view position and scale, the touch listener contains state that is dependent upon the imageview state ?
Based upon their respective .reset() methods (which are more comprehensive than the setScale and setPosition methods) I've added .setTo(...) methods to GestureImageView...
public void reset() {
x = centerX;
y = centerY;
scaleAdjust = startingScale;
if (gestureImageViewTouchListener != null) {
gestureImageViewTouchListener.reset();
}
redraw();
}
public void setTo(float newX, float newY, float newScale) {
x = newX;
y = newY;
scaleAdjust = newScale;
if (gestureImageViewTouchListener != null) {
gestureImageViewTouchListener.setTo(newX, newY, newScale);
}
redraw();
}
Using these methods results in the imagview displaying at the new scale and position. If I drag the image and then zoom it works as expected. However, if I just zoom the image (without having first panned) it reverts to the default scale and position.
Before I throw more hours at this, any advice on likely directions to proceed in ?
The text was updated successfully, but these errors were encountered:
I was tempted to change setScale and setPostion to also work like this, but they are used internally in GestureImageView and I'd rather not cause breakage.
Leads me to the question, were setScale and setPosition only expected to work as used internally and I shouldn't have expected them to work as part of the the public API yet ?
Using setScale and setPosition seems to work initially (imageview shows image at specified scale and position), but any touch interaction results in imageview immediately reverting to default position and scale.
May be related to #27 ,but @silentw's fix:
...doesn't solve the problem for me.
After much mucking about with setScale and setPosition it seems the problem lays in the touch listener not being set to match the view position and scale, the touch listener contains state that is dependent upon the imageview state ?
Based upon their respective
.reset()
methods (which are more comprehensive than the setScale and setPosition methods) I've added.setTo(...)
methods to GestureImageView......and GestureImageViewTouchListener...
Using these methods results in the imagview displaying at the new scale and position. If I drag the image and then zoom it works as expected. However, if I just zoom the image (without having first panned) it reverts to the default scale and position.
Before I throw more hours at this, any advice on likely directions to proceed in ?
The text was updated successfully, but these errors were encountered: