mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-07 14:38:11 +08:00
Bezier-rs: Updated Bezier function signatures to accept TValue (#967)
* Create helper for converting d to t values * Add euclidean option for tangent and normal * Modified bezier functions signatures to accept ComputeType * Stylistic changes per review * Added ComputeType documentation * Renamed ComputeType to TValue * Fixed comments * Fixed failing unit tests * Code review * Fix comments in code review * Renamed compute_type_to_parametric to t_value_to_parametric --------- Co-authored-by: Linda Zheng <thelindazheng@gmail.com> Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Linda Zheng
Keavon Chambers
parent
f0ad4c91d3
commit
a64c856ec4
@@ -1,6 +1,6 @@
|
||||
import subpathFeatures, { SubpathFeatureKey } from "@/features/subpath-features";
|
||||
import { renderDemoPane } from "@/utils/render";
|
||||
import { ComputeType, Demo, DemoPane, SliderOption, SubpathDemoArgs } from "@/utils/types";
|
||||
import { TVariant, Demo, DemoPane, SliderOption, SubpathDemoArgs } from "@/utils/types";
|
||||
|
||||
class SubpathDemoPane extends HTMLElement implements DemoPane {
|
||||
// Props
|
||||
@@ -12,14 +12,14 @@ class SubpathDemoPane extends HTMLElement implements DemoPane {
|
||||
|
||||
triggerOnMouseMove!: boolean;
|
||||
|
||||
chooseComputeType!: boolean;
|
||||
chooseTVariant!: boolean;
|
||||
|
||||
// Data
|
||||
demos!: SubpathDemoArgs[];
|
||||
|
||||
id!: string;
|
||||
|
||||
computeType!: ComputeType;
|
||||
tVariant!: TVariant;
|
||||
|
||||
connectedCallback(): void {
|
||||
this.demos = [
|
||||
@@ -47,14 +47,13 @@ class SubpathDemoPane extends HTMLElement implements DemoPane {
|
||||
closed: true,
|
||||
},
|
||||
];
|
||||
this.computeType = "Parametric";
|
||||
|
||||
this.tVariant = "Parametric";
|
||||
this.key = (this.getAttribute("name") || "") as SubpathFeatureKey;
|
||||
this.id = `subpath/${this.key}`;
|
||||
this.name = subpathFeatures[this.key].name;
|
||||
this.sliderOptions = JSON.parse(this.getAttribute("sliderOptions") || "[]");
|
||||
this.triggerOnMouseMove = this.getAttribute("triggerOnMouseMove") === "true";
|
||||
this.chooseComputeType = this.getAttribute("chooseComputeType") === "true";
|
||||
this.chooseTVariant = this.getAttribute("chooseTVariant") === "true";
|
||||
|
||||
this.render();
|
||||
}
|
||||
@@ -71,7 +70,7 @@ class SubpathDemoPane extends HTMLElement implements DemoPane {
|
||||
subpathDemo.setAttribute("key", this.key);
|
||||
subpathDemo.setAttribute("sliderOptions", JSON.stringify(this.sliderOptions));
|
||||
subpathDemo.setAttribute("triggerOnMouseMove", String(this.triggerOnMouseMove));
|
||||
subpathDemo.setAttribute("computetype", this.computeType);
|
||||
subpathDemo.setAttribute("tvariant", this.tVariant);
|
||||
return subpathDemo;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user