From 61b5c6033e4b108c74b961c5b01d3d1a249d85b5 Mon Sep 17 00:00:00 2001
From: Samuel Selleck <samuel@pax.dev>
Date: Mon, 12 Feb 2024 19:25:26 -0800
Subject: [PATCH] exposed rendering type

---
 pax-engine/src/lib.rs        |  1 +
 pax-runtime/src/rendering.rs | 39 ++++++++++++++++++++++++++++++++----
 2 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/pax-engine/src/lib.rs b/pax-engine/src/lib.rs
index 1154f64ec..666ece346 100644
--- a/pax-engine/src/lib.rs
+++ b/pax-engine/src/lib.rs
@@ -2,6 +2,7 @@ pub extern crate pax_macro;
 pub use pax_macro::*;
 
 pub use pax_runtime::api;
+pub use pax_runtime::rendering;
 
 pub use pax_runtime::api::log;
 pub use pax_runtime::api::serde;
diff --git a/pax-runtime/src/rendering.rs b/pax-runtime/src/rendering.rs
index 8c28a87d5..7560df227 100644
--- a/pax-runtime/src/rendering.rs
+++ b/pax-runtime/src/rendering.rs
@@ -2,7 +2,7 @@ use std::any::Any;
 use std::cell::RefCell;
 
 use std::iter;
-use std::ops::Mul;
+use std::ops::{Add, Div, Mul, Sub};
 use std::rc::Rc;
 
 use crate::api::{CommonProperties, RenderContext};
@@ -32,10 +32,41 @@ pub struct InstantiationArgs {
     pub template_node_id: usize,
 }
 
-#[derive(Copy, Clone)]
+#[derive(Copy, Clone, Default)]
 pub struct Point2D {
-    x: f64,
-    y: f64,
+    pub x: f64,
+    pub y: f64,
+}
+
+impl Add<Point2D> for Point2D {
+    type Output = Point2D;
+
+    fn add(self, rhs: Point2D) -> Self::Output {
+        Self::Output {
+            x: self.x + rhs.x,
+            y: self.y + rhs.y,
+        }
+    }
+}
+
+impl Sub<Point2D> for Point2D {
+    type Output = Point2D;
+    fn sub(self, rhs: Point2D) -> Self::Output {
+        Self::Output {
+            x: self.x - rhs.x,
+            y: self.y - rhs.y,
+        }
+    }
+}
+
+impl Div<f64> for Point2D {
+    type Output = Point2D;
+    fn div(self, rhs: f64) -> Self::Output {
+        Self::Output {
+            x: self.x / rhs,
+            y: self.y / rhs,
+        }
+    }
 }
 
 impl Point2D {