Issue #139: Changing page layout reset the current page

This commit is contained in:
Jakub Melka 2023-12-30 16:45:27 +01:00
parent 8338d7d85d
commit 1a66b804a2
2 changed files with 18 additions and 0 deletions

View File

@ -1328,7 +1328,24 @@ void PDFDrawWidgetProxy::setPageLayout(PageLayout pageLayout)
{
if (getPageLayout() != pageLayout)
{
std::optional<PDFInteger> pageIndex;
if (m_widget)
{
std::vector<PDFInteger> currentPages = m_widget->getDrawWidget()->getCurrentPages();
if (!currentPages.empty())
{
pageIndex = currentPages.front();
}
}
m_controller->setPageLayout(pageLayout);
if (pageIndex.has_value())
{
goToPage(*pageIndex);
}
Q_EMIT pageLayoutChanged();
}
}

View File

@ -1,4 +1,5 @@
CURRENT:
- Issue #139: Changing page layout reset the current page
- Issue #137: Redaction - Cannot convert '#000000' to color value
- Issue #134: Add search bar for actions
- Issue #133: Rectangle selector when choosing the page of the PDF