android - Moving hotspots i.e View over scaled & panned Image. -
i have been working on panning image in container using touchimageview. trying achieve want translate other view respect amount of panning i.e translation made.
below action_move event when user makes pan event.
case motionevent.action_move: if (state == state.drag) { float deltax = curr.x - last.x; float deltay = curr.y - last.y; float fixtransx = getfixdragtrans(deltax, viewwidth, getimagewidth()); float fixtransy = getfixdragtrans(deltay, viewheight, getimageheight()); matrix.posttranslate(fixtransx, fixtransy); fixtrans(); // function callbacks. // want restrict callback if translation values matrix 0 after scaling / zooming // still gives values > 0 if trying pan. moveviewswithsamedistance(fixtransx, fixtransy); last.set(curr.x, curr.y); } break;
the issue facing works while translating tags on panned image. when image has reached bounds still translationx or translationy values greater/less 0 makes tags move out of bound. there way can restrict translation.? have tried matrix method. still translation values above 0 after reach bounds when image scaled.
Comments
Post a Comment