Merge pull request '[PDF] Fix Bug 72451' (#227) from fix/bugfix into release/v8.3.0

This commit is contained in:
Julia Radzhabova
2025-01-15 16:13:05 +00:00

View File

@ -895,6 +895,20 @@ define([], function () {
var showPoint = [(bounds[0] + bounds[2])/2 - textContainer.outerWidth()/2, me.lastAnnotSelBarOnTop ? bounds[1] - textContainer.outerHeight() - 10 : bounds[3] + 10];
(showPoint[0]<0) && (showPoint[0] = 0);
showPoint[1] = Math.min(me._Height - textContainer.outerHeight(), Math.max(0, showPoint[1]));
var popover = this.getApplication().getController('Common.Controllers.Comments').getPopover();
if (popover && popover.isVisible()) {
var bounds = {
left: popover.getLeft(), right: popover.getLeft() + popover.getWidth(),
top: popover.getTop(), bottom: popover.getTop() + popover.getHeight()
},
right = showPoint[0] + textContainer.outerWidth(),
bottom = showPoint[1] + textContainer.outerHeight();
if ((right>bounds.left && right<bounds.right || showPoint[0]>bounds.left && showPoint[0]<bounds.right) &&
(showPoint[1]>bounds.top && showPoint[1]<bounds.bottom || bottom>bounds.top && bottom<bounds.bottom)) {
showPoint[0] = Common.UI.isRTL() ? bounds.right : bounds.left - textContainer.outerWidth();
}
}
textContainer.css({left: showPoint[0], top : showPoint[1]});
var diffDown = me._Height - showPoint[1] - textContainer.outerHeight(),