Skip to content

Commit

Permalink
fix(geom): add missing translate() impls for Cubic/Quadratic
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Nov 16, 2020
1 parent 2ce5ec1 commit fe4c027
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/geom/src/ops/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { add2, add3, ReadonlyVec, set2, set3 } from "@thi.ng/vectors";
import { AABB } from "../api/aabb";
import { Arc } from "../api/arc";
import { Circle } from "../api/circle";
import { Cubic } from "../api/cubic";
import { Ellipse } from "../api/ellipse";
import { Group } from "../api/group";
import { Line } from "../api/line";
Expand All @@ -13,6 +14,7 @@ import { Points, Points3 } from "../api/points";
import { Polygon } from "../api/polygon";
import { Polyline } from "../api/polyline";
import { Quad } from "../api/quad";
import { Quadratic } from "../api/quadratic";
import { Ray } from "../api/ray";
import { Rect } from "../api/rect";
import { Sphere } from "../api/sphere";
Expand All @@ -37,6 +39,8 @@ translate.addAll(<IObjectOf<Implementation2<unknown, ReadonlyVec, IShape>>>{
[Type.CIRCLE]: ($: Circle, delta) =>
new Circle(add2([], $.pos, delta), $.r, copyAttribs($)),

[Type.CUBIC]: tx(Cubic),

[Type.ELLIPSE]: ($: Ellipse, delta) =>
new Ellipse(add2([], $.pos, delta), set2([], $.r), copyAttribs($)),

Expand Down Expand Up @@ -74,6 +78,8 @@ translate.addAll(<IObjectOf<Implementation2<unknown, ReadonlyVec, IShape>>>{

[Type.QUAD]: tx(Quad),

[Type.QUADRATIC]: tx(Quadratic),

[Type.RAY]: ($: Ray, delta) =>
new Ray(add2([], $.pos, delta), $.dir, copyAttribs($)),

Expand Down

0 comments on commit fe4c027

Please sign in to comment.