Skip to content

Commit

Permalink
Fix rendering issue
Browse files Browse the repository at this point in the history
Fix rendering fail due to Undefined, and spelling mistake
  • Loading branch information
tascord authored Feb 11, 2024
2 parents e849ab6 + 0c89710 commit 421349e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ It is important then, that you know which variables are being parsed to the func
segment: Segment {
borderColor:
FnWithArgs::new() // Create the Function
.arg("ctx") // Add a named arguement using a builder pattern
.arg("ctx") // Add a named argument using a builder pattern
.body("ctx.p0.parsed.y > ctx.p1.parsed.y ? 'red' : 'green'") // Add the function body, in this case make the line red if the slope is negative
}
}
]
}
}
```
```
6 changes: 6 additions & 0 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ impl Chart {

let dash = Reflect::get(&segment, &"borderDash".into());
if let Ok(dash) = dash {
if dash == JsValue::UNDEFINED {
return;
}
Reflect::set(
&segment,
&"borderDash".into(),
Expand All @@ -66,6 +69,9 @@ impl Chart {

let color = Reflect::get(&segment, &"borderColor".into());
if let Ok(color) = color {
if color == JsValue::UNDEFINED {
return;
}
Reflect::set(
&segment,
&"borderColor".into(),
Expand Down

0 comments on commit 421349e

Please sign in to comment.