Skip to content

Commit

Permalink
refactor(geom): update offset() line impl
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jun 20, 2020
1 parent d1d4336 commit 6958280
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/geom/src/ops/offset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ import type { IObjectOf } from "@thi.ng/api";
import { defmulti, Implementation2 } from "@thi.ng/defmulti";
import { IShape, Type } from "@thi.ng/geom-api";
import {
add2,
addN2,
max2,
normalCW,
set2,
ZERO2,
normalCCW,
add2,
sub2,
ZERO2,
} from "@thi.ng/vectors";
import { Circle } from "../api/circle";
import { Line } from "../api/line";
import { Quad } from "../api/quad";
import { Rect } from "../api/rect";
import { rectFromCentroid } from "../ctors/rect";
import { copyAttribs } from "../internal/copy-attribs";
import { dispatch } from "../internal/dispatch";
import { centroid } from "./centroid";
import { Line } from "../api/line";
import { Quad } from "../api/quad";

export const offset = defmulti<IShape, number, IShape>(dispatch);

Expand All @@ -26,7 +26,7 @@ offset.addAll(<IObjectOf<Implementation2<unknown, number, IShape>>>{
new Circle(set2([], $.pos), Math.max($.r + n, 0)),

[Type.LINE]: ({ points: [a, b], attribs }: Line, n) => {
const norm = normalCCW([], a, b, n);
const norm = normalCW([], a, b, n);
return new Quad(
[
add2([], a, norm),
Expand Down

0 comments on commit 6958280

Please sign in to comment.