|
@@ -747,11 +747,13 @@ export default class Shape extends Base {
|
|
|
let windowCoordinates = this.getMouseLocation(event);
|
|
|
const page = documentViewer.getSelectedPage(windowCoordinates, windowCoordinates)
|
|
|
if (page.first && page.first !== (this.page + 1)) {
|
|
|
+ const pagePoint = documentViewer.windowToPage(windowCoordinates, page.first, false)
|
|
|
+
|
|
|
const annotationHeight = Math.abs(leftTop.y - rightBottom.y)
|
|
|
left = pageX - (startState.clickX - leftTop.x)
|
|
|
- top = page.first > (this.page + 1) ? 0 : height - annotationHeight
|
|
|
+ top = page.first > (this.page + 1) ? pagePoint.y : pagePoint.y - annotationHeight
|
|
|
right = pageX - (startState.clickX - rightBottom.x)
|
|
|
- bottom = page.first > (this.page + 1) ? annotationHeight : height
|
|
|
+ bottom = page.first > (this.page + 1) ? pagePoint.y + annotationHeight : pagePoint.y
|
|
|
this.page = page.first - 1
|
|
|
|
|
|
this.annotationContainer.remove()
|