Skip to content

Projectrix v0.1.2 alpha

Choose a tag to compare

@serranocirrus serranocirrus released this 26 Mar 10:12
· 141 commits to main since this release

The Projectrix api is now even breezier; see updated usages for examples of the new types and functions.

  • added PartialProjection and PartialProjectionResults types for convenience, in case you want to delete members from projections
export type PartialProjection = Partial<Projection>;

export type PartialProjectionResults = {
  toSubject: PartialProjection;
  toTargetOrigin: PartialProjection;
  transformType: TransformType;
  subject: HTMLElement;
  target: HTMLElement;
};
  • added setInlineStyles and clearInlineStyles functions
/**
 * sets the inline style on the target for each style in the given partial projection.
 * converts any matrix3d or transformMat4 value to a transform style
 */
export function setInlineStyles(target: HTMLElement, partialProjection: PartialProjection): void;

/**
 * clears the inline style on the target for each style in the given partial projection.
 * if no partial projection is given, assumes target's inline styles were set to a full projection.
 * if the projection contains matrix3d or transformMat4, then the transform style is cleared
 */
export function clearInlineStyles(target: HTMLElement, partialProjection?: PartialProjection): void;