Skip to content

Commit

Permalink
designer working
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelselleck authored and zackbrown committed Mar 8, 2024
1 parent bad3474 commit 64c1435
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
3 changes: 2 additions & 1 deletion pax-runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ serde = {version = "1.0.159", features=["derive"] }
wasm-bindgen = {version = "0.2.80", features=["serde-serialize"]}
kurbo = "0.9.0"
piet = "0.6.0"
pax-message = {version="0.12.3", path="../pax-message"}
pax-message = {version="0.12.3", path="../pax-message"}
log = "0.4.20"
6 changes: 3 additions & 3 deletions pax-runtime-api/src/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ impl<T: Default> PropertyExpression<T> {

impl<T: Default + Clone> PropertyInstance<T> for PropertyExpression<T> {
fn get(&self) -> &T {
if !self.has_been_evaluted {
panic!("expression with id {:?} hasn't been evaluated", self.id)
}
// if !self.has_been_evaluted {
// panic!("expression with id {:?} hasn't been evaluated", self.id)
// }
&self.cached_value
}

Expand Down
11 changes: 11 additions & 0 deletions pax-runtime-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,17 @@ impl From<IntoableLiteral> for ColorChannel {
}
}
}
impl From<f64> for ColorChannel {
fn from(value: f64) -> Self {
Numeric::Float(value).into()
}
}

impl From<isize> for ColorChannel {
fn from(value: isize) -> Self {
Numeric::Integer(value).into()
}
}

impl From<IntoableLiteral> for Size {
fn from(value: IntoableLiteral) -> Self {
Expand Down
6 changes: 6 additions & 0 deletions pax-runtime/src/api.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
use crate::RuntimeContext;
pub use pax_runtime_api::*;
#[cfg(feature = "designtime")]
use {
crate::api::math::Point2, crate::node_interface::NodeInterface,
pax_designtime::DesigntimeManager, pax_manifest::UniqueTemplateNodeIdentifier,
std::cell::RefCell, std::rc::Rc,
};

#[derive(Clone)]
#[cfg_attr(debug_assertions, derive(Debug))]
Expand Down
4 changes: 2 additions & 2 deletions pax-runtime/src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ impl PaxEngine {
expression_table: ExpressionTable,
viewport_size: (f64, f64),
) -> Self {
use crate::api::math::Transform2;
use pax_runtime_api::math::Transform2;

let globals = Globals {
frames_elapsed: 0,
Expand Down Expand Up @@ -320,7 +320,7 @@ impl PaxEngine {
viewport_size: (f64, f64),
designtime: Rc<RefCell<DesigntimeManager>>,
) -> Self {
use crate::math::Transform2;
use pax_runtime_api::math::Transform2;
let globals = Globals {
frames_elapsed: 0,
viewport: TransformAndBounds {
Expand Down

0 comments on commit 64c1435

Please sign in to comment.