aboutsummaryrefslogtreecommitdiff
path: root/src/renderer.rs
diff options
context:
space:
mode:
authorRubén Beltrán del Río <jj@r.bdr.sh>2026-01-16 11:37:51 +0100
committerRubén Beltrán del Río <jj@r.bdr.sh>2026-01-16 11:49:15 +0100
commit09c1181cb4df744f0ea34eb0f1fd325850f6b128 (patch)
treedc161e628a087754be29e5c514fc8290d49273e0 /src/renderer.rs
parentf53588e276fba9db2f3bee6a3421f60d7c458813 (diff)
Add support for custom stage typesHEADmain
Diffstat (limited to 'src/renderer.rs')
-rw-r--r--src/renderer.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/renderer.rs b/src/renderer.rs
index 69c3f70..d91c3f0 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -38,7 +38,7 @@ use crate::utils::percent_to_pixel;
/// Returns `RenderError` if the surface creation, rendering, or PNG encoding fails
pub fn render_to_png(
map: &Map,
- stage_type: StageType,
+ stage_type: &StageType,
configuration: &Configuration,
) -> Result<Vec<u8>, RenderError> {
// Safe cast: map dimensions are typically in the range of hundreds to thousands of pixels
@@ -80,7 +80,7 @@ pub fn render_to_png(
/// Returns `RenderError` if the surface creation or rendering fails
pub fn render_to_surface(
map: &Map,
- stage_type: StageType,
+ stage_type: &StageType,
configuration: &Configuration,
) -> Result<ImageSurface, RenderError> {
// Safe cast: map dimensions are typically in the range of hundreds to thousands of pixels
@@ -120,7 +120,7 @@ pub fn render_to_surface(
/// Returns `RenderError` if the surface creation, rendering, or file I/O fails
pub fn render_to_svg(
map: &Map,
- stage_type: StageType,
+ stage_type: &StageType,
configuration: &Configuration,
) -> Result<String, RenderError> {
let total_width = configuration.theme.sizes.map_width + configuration.theme.sizes.padding * 2.0;
@@ -150,7 +150,7 @@ pub fn render_to_svg(
fn render(
context: &Context,
map: &Map,
- stage_type: StageType,
+ stage_type: &StageType,
configuration: &Configuration,
) -> Result<(), RenderError> {
// Apply padding transform
@@ -177,7 +177,7 @@ fn render(
draw_background(context, configuration)?;
if configuration.options.show_background {
- draw_stage_patterns(context, stage_type, map, configuration)?;
+ draw_stage_patterns(context, map, configuration)?;
}
draw_axes(context, stage_type, map, configuration)?;
@@ -205,7 +205,6 @@ fn draw_background(context: &Context, configuration: &Configuration) -> Result<(
fn draw_stage_patterns(
context: &Context,
- _stage_type: StageType,
map: &Map,
configuration: &Configuration,
) -> Result<(), RenderError> {
@@ -276,7 +275,7 @@ fn draw_stage_patterns(
fn draw_axes(
context: &Context,
- stage_type: StageType,
+ stage_type: &StageType,
map: &Map,
configuration: &Configuration,
) -> Result<(), RenderError> {