Extract document resize planning
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "pch.h"
|
||||
#include "app.h"
|
||||
#include "action.h"
|
||||
#include "app_core/document_resize.h"
|
||||
#include "app_core/document_export.h"
|
||||
#include "app_core/document_session.h"
|
||||
#include "settings.h"
|
||||
@@ -558,9 +559,15 @@ void App::dialog_resize()
|
||||
|
||||
dialog->btn_ok->on_click = [this,dialog](Node*)
|
||||
{
|
||||
int res = dialog->get_resolution();
|
||||
const auto plan = pp::app::plan_document_resize(
|
||||
dialog->combo ? dialog->combo->m_current_index : 0);
|
||||
if (!plan)
|
||||
{
|
||||
dialog->destroy();
|
||||
return;
|
||||
}
|
||||
if (canvas)
|
||||
canvas->m_canvas->resize(res, res);
|
||||
canvas->m_canvas->resize(plan.value().width, plan.value().height);
|
||||
App::I->title_update();
|
||||
ActionManager::clear();
|
||||
dialog->destroy();
|
||||
|
||||
Reference in New Issue
Block a user