23#include <rtl/math.hxx>
56 const bool bOverflowInX(!rtl::math::approxEqual(
static_cast<double>(rRect.getOpenWidth()),
static_cast<double>(rRect.Right()) -
static_cast<double>(rRect.Left())));
57 const bool bOverflowInY(!rtl::math::approxEqual(
static_cast<double>(rRect.getOpenHeight()),
static_cast<double>(rRect.Bottom()) -
static_cast<double>(rRect.Top())));
59 if(bOverflowInX || bOverflowInY)
61 SAL_WARN(
"sd",
"The given Rectangle contains values that lead to numerical overflows (!)");
71 const Size aLogicSize(rRect.GetSize());
90 sal_Int32 nFreeSpaceX(aVisAreaSize.
Width() - aLogicSize.
Width());
91 sal_Int32 nFreeSpaceY(aVisAreaSize.
Height() - aLogicSize.
Height());
94 const sal_Int32 nPercentBorder(30);
95 const ::tools::Rectangle aInnerRectangle(
96 aVisArea.
Left() + ((aVisAreaSize.
Width() * nPercentBorder) / 200),
97 aVisArea.
Top() + ((aVisAreaSize.
Height() * nPercentBorder) / 200),
98 aVisArea.
Right() - ((aVisAreaSize.
Width() * nPercentBorder) / 200),
99 aVisArea.
Bottom() - ((aVisAreaSize.
Height() * nPercentBorder) / 200)
105 if(aInnerRectangle.Left() > rRect.Right())
111 if(aInnerRectangle.Right() < rRect.Left())
119 if(nFreeSpaceX > rRect.GetWidth())
121 nFreeSpaceX = rRect.GetWidth();
126 SAL_WARN(
"sd",
"The given Rectangle contains values that lead to numerical overflows (!)");
130 const ::tools::Long distRight(rRect.Right() - aNewPos.
X() - aVisAreaSize.
Width());
135 aNewPos.
AdjustX(mult * nFreeSpaceX );
138 const ::tools::Long distLeft(aNewPos.
X() - rRect.Left());
143 aNewPos.
AdjustX( -(mult * nFreeSpaceX) );
150 if(aInnerRectangle.Top() > rRect.Bottom())
156 if(aInnerRectangle.Bottom() < rRect.Top())
164 if(nFreeSpaceY > rRect.GetHeight())
166 nFreeSpaceY = rRect.GetHeight();
171 SAL_WARN(
"sd",
"The given Rectangle contains values that lead to numerical overflows (!)");
175 const ::tools::Long distBottom(rRect.Bottom() - aNewPos.
Y() - aVisAreaSize.
Height());
180 aNewPos.
AdjustY(mult * nFreeSpaceY );
183 const ::tools::Long distTop(aNewPos.
Y() - rRect.Top());
188 aNewPos.
AdjustY( -(mult * nFreeSpaceY) );
194 if(aNewPos != aVisArea.
TopLeft())
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
sd::ViewShell * GetViewShell()
void GotoBookmark(std::u16string_view rBookmark)
void Connect(sd::ViewShell *pViewSh)
bool IsMouseSelecting() const
virtual void SetZoomRect(const ::tools::Rectangle &rZoomRect) override
Set zoom rectangle for active window.
void GotoBookmark(std::u16string_view rBookmark)
void MakeVisible(const ::tools::Rectangle &rRect, vcl::Window &rWin)
Make area visible (scroll part of picture) |* .
bool IsMouseButtonDown() const
static bool IsRunning(ViewShellBase const &rBase)
returns true if there is a running presentation for the given ViewShellBase
SD_DLLPUBLIC DrawDocShell * GetDocSh() const
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
bool IsMapModeEnabled() const
::OutputDevice const * GetOutDev() const
Point PixelToLogic(const Point &rDevicePt) const
Size GetOutputSizePixel() const
void EnableMapMode(bool bEnable=true)
#define SAL_WARN(area, stream)