错误处理

This commit is contained in:
2026-08-16 17:53:46 +08:00
parent 00a3c54820
commit 8612b5ff86
47 changed files with 744 additions and 544 deletions
+4 -2
View File
@@ -159,7 +159,9 @@ struct Web_Plot_Session::Impl {
apply_layout(plot.viewport_size());
plot.activate_view();
update_model();
(void)plot.render_frame(true);
const auto initial_render = plot.render_frame(true);
if (initial_render != Plot_Render_Error::none)
plot.request_redraw();
}
~Impl() {
plot.deactivate_view();
@@ -266,7 +268,7 @@ struct Web_Plot_Session::Impl {
if (!plot.view_active())
return std::nullopt;
update_model();
if (!plot.render_frame(true))
if (plot.render_frame(true) != Plot_Render_Error::none)
return std::nullopt;
std::string pixels;
const Color background = plot.background_color();