Skip to content

Commit

Permalink
refactor(imgui): update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Feb 24, 2020
1 parent 165ac9a commit feba46c
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/imgui/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Predicate } from "@thi.ng/api";
import type { Predicate } from "@thi.ng/api";

export type Color = string | number | number[];

Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/behaviors/button.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { pointInside } from "@thi.ng/geom";
import { IShape } from "@thi.ng/geom-api";
import { Key } from "../api";
import { IMGUI } from "../gui";
import type { IShape } from "@thi.ng/geom-api";

export const isHoverButton = (gui: IMGUI, id: string, shape: IShape) => {
if (gui.disabled) return false;
Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/behaviors/slider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { pointInside } from "@thi.ng/geom";
import { IShape } from "@thi.ng/geom-api";
import { clamp, roundTo } from "@thi.ng/math";
import {
add2,
Expand All @@ -9,6 +8,7 @@ import {
} from "@thi.ng/vectors";
import { Key } from "../api";
import { IMGUI } from "../gui";
import type { IShape } from "@thi.ng/geom-api";

export const isHoverSlider = (
gui: IMGUI,
Expand Down
4 changes: 2 additions & 2 deletions packages/imgui/src/components/button.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { rect } from "@thi.ng/geom";
import { IShape } from "@thi.ng/geom-api";
import { IGridLayout, isLayout, LayoutBox } from "@thi.ng/layout";
import { hash, ZERO2 } from "@thi.ng/vectors";
import { Color, Hash } from "../api";
import { handleButtonKeys, isHoverButton } from "../behaviors/button";
import { IMGUI } from "../gui";
import { labelHash } from "../hash";
import { textLabelRaw, textTransformH, textTransformV } from "./textlabel";
import { tooltipRaw } from "./tooltip";
import type { IShape } from "@thi.ng/geom-api";
import type { Color, Hash } from "../api";

const mkLabel = (transform: number[], fill: Color, label: string) =>
textLabelRaw(ZERO2, { transform, fill }, label);
Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/dial.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Fn } from "@thi.ng/api";
import { circle, line } from "@thi.ng/geom";
import { IGridLayout, isLayout, LayoutBox } from "@thi.ng/layout";
import {
Expand All @@ -14,6 +13,7 @@ import { IMGUI } from "../gui";
import { valHash } from "../hash";
import { textLabelRaw } from "./textlabel";
import { tooltipRaw } from "./tooltip";
import type { Fn } from "@thi.ng/api";

export const dial = (
gui: IMGUI,
Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/ring.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Fn } from "@thi.ng/api";
import { polygon } from "@thi.ng/geom";
import { pointInRect } from "@thi.ng/geom-isec";
import { IGridLayout, isLayout, LayoutBox } from "@thi.ng/layout";
Expand All @@ -18,6 +17,7 @@ import { IMGUI } from "../gui";
import { valHash } from "../hash";
import { textLabelRaw } from "./textlabel";
import { tooltipRaw } from "./tooltip";
import type { Fn } from "@thi.ng/api";

const ringHeight = (w: number, thetaGap: number) =>
(w / 2) * (1 + Math.sin(HALF_PI + thetaGap / 2));
Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/sliderh.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Fn } from "@thi.ng/api";
import { rect } from "@thi.ng/geom";
import { IGridLayout, isLayout, LayoutBox } from "@thi.ng/layout";
import { fit, norm } from "@thi.ng/math";
Expand All @@ -8,6 +7,7 @@ import { IMGUI } from "../gui";
import { valHash } from "../hash";
import { textLabelRaw } from "./textlabel";
import { tooltipRaw } from "./tooltip";
import type { Fn } from "@thi.ng/api";

export const sliderH = (
gui: IMGUI,
Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/sliderv.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Fn } from "@thi.ng/api";
import { rect } from "@thi.ng/geom";
import { IGridLayout, isLayout, LayoutBox } from "@thi.ng/layout";
import { fit, norm } from "@thi.ng/math";
Expand All @@ -8,6 +7,7 @@ import { IMGUI } from "../gui";
import { valHash } from "../hash";
import { textLabelRaw, textTransformV } from "./textlabel";
import { tooltipRaw } from "./tooltip";
import type { Fn } from "@thi.ng/api";

export const sliderV = (
gui: IMGUI,
Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/textfield.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Predicate } from "@thi.ng/api";
import { rect } from "@thi.ng/geom";
import { IGridLayout, isLayout, LayoutBox } from "@thi.ng/layout";
import { fitClamped } from "@thi.ng/math";
Expand All @@ -8,6 +7,7 @@ import { isHoverSlider } from "../behaviors/slider";
import { IMGUI } from "../gui";
import { textLabelRaw } from "./textlabel";
import { tooltipRaw } from "./tooltip";
import type { Predicate } from "@thi.ng/api";

interface TextfieldState {
cursor: number;
Expand Down
4 changes: 2 additions & 2 deletions packages/imgui/src/components/textlabel.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { isPlainObject } from "@thi.ng/checks";
import { IGridLayout, isLayout, LayoutBox } from "@thi.ng/layout";
import { ReadonlyVec } from "@thi.ng/vectors";
import { Color, GUITheme } from "../api";
import { IMGUI } from "../gui";
import type { ReadonlyVec } from "@thi.ng/vectors";
import type { Color, GUITheme } from "../api";

export const textLabel = (
gui: IMGUI,
Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/xypad.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Fn } from "@thi.ng/api";
import { line, rect } from "@thi.ng/geom";
import { IGridLayout, LayoutBox } from "@thi.ng/layout";
import { fit2, hash, Vec } from "@thi.ng/vectors";
import { handleSlider2Keys, isHoverSlider, slider2Val } from "../behaviors/slider";
import { IMGUI } from "../gui";
import { textLabelRaw } from "./textlabel";
import { tooltipRaw } from "./tooltip";
import type { Fn } from "@thi.ng/api";

/**
* `mode` interpretation:
Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/gui.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Fn0, IClear, IToHiccup } from "@thi.ng/api";
import { set2, Vec } from "@thi.ng/vectors";
import {
DEFAULT_THEME,
Expand All @@ -10,6 +9,7 @@ import {
MouseButton,
NONE
} from "./api";
import type { Fn0, IClear, IToHiccup } from "@thi.ng/api";

export class IMGUI implements IClear, IToHiccup {
attribs!: any;
Expand Down

0 comments on commit feba46c

Please sign in to comment.