Skip to content

Commit efc52cd

Browse files
committed
Merge pull request amlcurran#377 from robhor/fix-showcase-animation
Fix incorrect start position of showcase animation
2 parents c35bb77 + be479c5 commit efc52cd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

library/src/main/java/com/github/amlcurran/showcaseview/ShowcaseView.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -225,19 +225,21 @@ public boolean hasShowcaseView() {
225225
}
226226

227227
public void setShowcaseX(int x) {
228-
setShowcasePosition(x, showcaseY);
228+
setShowcasePosition(x, getShowcaseY());
229229
}
230230

231231
public void setShowcaseY(int y) {
232-
setShowcasePosition(showcaseX, y);
232+
setShowcasePosition(getShowcaseX(), y);
233233
}
234234

235235
public int getShowcaseX() {
236-
return showcaseX;
236+
getLocationInWindow(positionInWindow);
237+
return showcaseX + positionInWindow[0];
237238
}
238239

239240
public int getShowcaseY() {
240-
return showcaseY;
241+
getLocationInWindow(positionInWindow);
242+
return showcaseY + positionInWindow[1];
241243
}
242244

243245
/**

0 commit comments

Comments
 (0)