Rename vector components to match new terminology (#719)

* Renamed VectorAnchor, VectorShape and VectorControlPoint. Also fixed other naming inconsistencies.

* Renamed messages relating to vector and updated naming in several tools

* Renamed comments + caught a few areas I had missed.

* Caught a few more incorrect names

* Code review pass

* Review changes

* Fixed warning

* Additional review feedback

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Oliver Davies
2022-07-12 17:59:06 -07:00
committed by Keavon Chambers
co-authored by Keavon Chambers
parent 5d1d93917d
commit 03633bf313
39 changed files with 1125 additions and 1095 deletions
+3 -5
View File
@@ -114,9 +114,9 @@ export default defineComponent({
name: "Lookup Table",
callback: (canvas: HTMLCanvasElement, bezier: WasmBezierInstance, options: Record<string, number>): void => {
const lookupPoints = bezier.compute_lookup_table(options.steps);
lookupPoints.forEach((serialisedPoint, index) => {
lookupPoints.forEach((serializedPoint, index) => {
if (index !== 0 && index !== lookupPoints.length - 1) {
drawPoint(getContextFromCanvas(canvas), JSON.parse(serialisedPoint), 3, COLORS.NON_INTERACTIVE.STROKE_1);
drawPoint(getContextFromCanvas(canvas), JSON.parse(serializedPoint), 3, COLORS.NON_INTERACTIVE.STROKE_1);
}
});
},
@@ -339,9 +339,7 @@ export default defineComponent({
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-family: Arial, sans-serif;
text-align: center;
color: #2c3e50;
margin-top: 60px;
+2 -2
View File
@@ -632,11 +632,11 @@ impl Bezier {
}
/// Determine if it is possible to scale the given curve, using the following conditions:
/// 1. All the control points are located on a single side of the curve.
/// 1. All the handles are located on a single side of the curve.
/// 2. The on-curve point for `t = 0.5` must occur roughly in the center of the polygon defined by the curve's endpoint normals.
/// See [the offset section](https://pomax.github.io/bezierinfo/#offsetting) of Pomax's bezier curve primer for more details.
fn is_scalable(&self) -> bool {
// Verify all the control points are located on a single side of the curve.
// Verify all the handles are located on a single side of the curve.
if let BezierHandles::Cubic { handle_start, handle_end } = self.handles {
let angle_1 = (self.end - self.start).angle_between(handle_start - self.start);
let angle_2 = (self.end - self.start).angle_between(handle_end - self.start);