Route canvas view execution through app core
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
#include "legacy_app_preference_services.h"
|
||||
|
||||
#include "app.h"
|
||||
#include "node_canvas.h"
|
||||
#include "legacy_canvas_view_services.h"
|
||||
#include "serializer.h"
|
||||
#include "settings.h"
|
||||
|
||||
@@ -24,12 +24,9 @@ public:
|
||||
|
||||
void apply_viewport_scale(const pp::app::ScaleApplicationPlan& plan) override
|
||||
{
|
||||
if (!app_.canvas)
|
||||
return;
|
||||
|
||||
app_.canvas->set_density(plan.scale);
|
||||
Settings::set("vp-scale", Serializer::Float(plan.scale));
|
||||
Settings::save();
|
||||
const auto status = execute_legacy_canvas_view_density(app_, plan.scale);
|
||||
if (!status.ok())
|
||||
LOG("Viewport scale preference failed: %s", status.message);
|
||||
}
|
||||
|
||||
void apply_interface_direction(const pp::app::InterfaceDirectionPlan& plan) override
|
||||
@@ -68,12 +65,9 @@ public:
|
||||
|
||||
void apply_canvas_cursor_mode(const pp::app::StoredIntegerPreferencePlan& plan) override
|
||||
{
|
||||
if (!app_.canvas)
|
||||
return;
|
||||
|
||||
app_.canvas->set_cursor_visibility(static_cast<NodeCanvas::kCursorVisibility>(plan.value));
|
||||
Settings::set("show-cursor", Serializer::Integer(plan.value));
|
||||
Settings::save();
|
||||
const auto status = execute_legacy_canvas_cursor_mode(app_, plan.value);
|
||||
if (!status.ok())
|
||||
LOG("Canvas cursor mode preference failed: %s", status.message);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user