fix: preserve exports on close and support themed PDF without export quotas

This commit is contained in:
2026-09-07 14:04:03 +08:00
parent b340145b3a
commit 32a45c4841
16 changed files with 342 additions and 121 deletions
+2 -2
View File
@@ -339,7 +339,7 @@ def _sample_segments(
return clipped
def compute_geometry(plot: FunctionPlot) -> PlotGeometry:
def compute_geometry(plot: FunctionPlot, unlimited: bool = False) -> PlotGeometry:
"""解析并计算几何,供 SVG 与 reportlab 后端复用。"""
warnings: list[str] = []
xmin, xmax = plot.domain
@@ -351,7 +351,7 @@ def compute_geometry(plot: FunctionPlot) -> PlotGeometry:
fns: list[tuple[object, object]] = []
for expr in plot.expressions:
try:
tree = parse_expression(expr.expression)
tree = parse_expression(expr.expression, unlimited=unlimited)
except PlotParseError as exc:
warnings.append(f"表达式无法渲染,已跳过:{expr.expression}{exc.diagnostic.message}")
continue