From 60ec38f0e5af5e900afa2d721271b337fa78aa03 Mon Sep 17 00:00:00 2001
From: Johannes Wolf <mail@johannes-wolf.com>
Date: Wed, 24 Jul 2024 01:44:05 +0200
Subject: [PATCH] fix(axes): Fix vector transformation for content

---
 src/axes.typ | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/axes.typ b/src/axes.typ
index 3b3c3e7..04d404b 100644
--- a/src/axes.typ
+++ b/src/axes.typ
@@ -496,10 +496,6 @@
 
   let (x, y, ..) = vec
 
-  if x < x-low or x > x-high or y < y-low or x > x-high {
-    return none
-  }
-
   return (
     (x - x-axis.min) * fx + ox,
     (y - y-axis.min) * fy + oy,
@@ -523,11 +519,16 @@
     ctx.transform = transform
 
     drawables = drawables.map(d => {
-      d.segments = d.segments.map(((kind, ..pts)) => {
-        (kind, ..pts.map(pt => {
-          transform-vec(size, x, y, none, pt)
-        }))
-      })
+      if "segments" in d {
+        d.segments = d.segments.map(((kind, ..pts)) => {
+          (kind, ..pts.map(pt => {
+            transform-vec(size, x, y, none, pt)
+          }))
+        })
+      }
+      if "pos" in d {
+        d.pos = transform-vec(size, x, y, none, d.pos)
+      }
       return d
     })