From 9d96db8078e8ab1cde95f3d83c5849017f384ef8 Mon Sep 17 00:00:00 2001 From: Johannes Wolf Date: Sat, 18 May 2024 00:32:23 +0200 Subject: [PATCH] debug: Tag debug shapes --- src/draw/shapes.typ | 2 +- src/drawable.typ | 6 ++++-- src/process.typ | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/draw/shapes.typ b/src/draw/shapes.typ index b237085aa..993cc3c84 100644 --- a/src/draw/shapes.typ +++ b/src/draw/shapes.typ @@ -1452,7 +1452,7 @@ } } for drawable in r.drawables { - if drawable.hidden { continue } + if drawable.hidden or "debug" in drawable { continue } assert.eq(drawable.type, "path") segments += drawable.segments } diff --git a/src/drawable.typ b/src/drawable.typ index 2c768e349..dde7c1db2 100644 --- a/src/drawable.typ +++ b/src/drawable.typ @@ -30,7 +30,7 @@ } } -#let path(close: false, fill: none, stroke: none, segments) = { +#let path(close: false, fill: none, stroke: none, segments, debug: false) = { let segments = segments // Handle case where only one segment has been passed if type(segments.first()) == str { @@ -53,7 +53,9 @@ stroke: stroke, hidden: false, bounds: true, - ) + ) + if debug { + (debug: true) + } } #let content(pos, width, height, border, body) = { diff --git a/src/process.typ b/src/process.typ index bca3ccaa8..7fa36868b 100644 --- a/src/process.typ +++ b/src/process.typ @@ -44,7 +44,8 @@ (bounds.low.at(0), bounds.high.at(1), 0) )), stroke: red, - close: true + close: true, + debug: true, )) }