Use transform from math. Update some interfaces
This commit is contained in:
parent
4e7f31e4a0
commit
311945df5c
8 changed files with 14 additions and 24 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { IRgbColor } from "./color";
|
||||
import { IPoint } from "@gxc-solutions/math";
|
||||
import { IRgbColor } from "./color";
|
||||
import { ImageSource } from "./image-source";
|
||||
|
||||
export type FillType = "solid" | "texture";
|
||||
export type GradientType = "liner" | "radial" | "conic";
|
||||
|
|
@ -15,7 +16,7 @@ export interface ISolidFill extends IBaseFill {
|
|||
|
||||
export interface ITextureFill extends IBaseFill {
|
||||
type: "texture";
|
||||
texture: HTMLImageElement;
|
||||
texture: ImageSource;
|
||||
}
|
||||
|
||||
export interface IGradientStop {
|
||||
|
|
|
|||
1
lib/src/interfaces/image-source.ts
Normal file
1
lib/src/interfaces/image-source.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export type ImageSource = HTMLImageElement | ImageBitmap | ImageData;
|
||||
|
|
@ -4,4 +4,4 @@ export * from "./objects";
|
|||
export * from "./fill";
|
||||
export * from "./color";
|
||||
export * from "./stroke";
|
||||
export * from "./transform";
|
||||
export * from "./image-source";
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { IPoint } from "@gxc-solutions/math";
|
||||
import { IPoint, ITransform } from "@gxc-solutions/math";
|
||||
import { IRgbColor } from "./color";
|
||||
import { Fill } from "./fill";
|
||||
import { ITransform } from "./transform";
|
||||
import { IStroke } from "./stroke";
|
||||
import { ImageSource } from "./image-source";
|
||||
|
||||
export interface IRectangle {
|
||||
x: number;
|
||||
|
|
@ -47,7 +47,7 @@ export interface IEllipseDrawObject extends IBaseDrawObject {
|
|||
|
||||
export interface IImageDrawObject extends IBaseDrawObject {
|
||||
readonly type: "image";
|
||||
source: HTMLImageElement | ImageBitmap;
|
||||
source: ImageSource;
|
||||
stroke: IStroke;
|
||||
rectangle: IRectangle;
|
||||
fill: Fill;
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
export interface ITransform {
|
||||
scaleX: number;
|
||||
scaleY: number;
|
||||
|
||||
translateY: number;
|
||||
translateX: number;
|
||||
|
||||
skewY: number;
|
||||
skewX: number;
|
||||
|
||||
rotate: number;
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@gxc-solutions/renderer-base",
|
||||
"version": "0.0.10",
|
||||
"version": "0.0.11",
|
||||
"main": "index.js",
|
||||
"author": "GXC Solutions",
|
||||
"publishConfig": {
|
||||
|
|
|
|||
8
package-lock.json
generated
8
package-lock.json
generated
|
|
@ -9,7 +9,7 @@
|
|||
"version": "0.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@gxc-solutions/math": "^0.0.2"
|
||||
"@gxc-solutions/math": "^0.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3.3.4",
|
||||
|
|
@ -208,9 +208,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@gxc-solutions/math": {
|
||||
"version": "0.0.2",
|
||||
"resolved": "https://npm.gxc-solutions.ru/@gxc-solutions/math/-/math-0.0.2.tgz",
|
||||
"integrity": "sha512-R6zYvbspis+XoHZ7lwyVLAUGZkJwivbeo94VtN7cSZzOA86AgVev+UQeHt9S1Ua4d1FwgxYVasck1/l5WXR7CQ=="
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://npm.gxc-solutions.ru/@gxc-solutions/math/-/math-0.0.3.tgz",
|
||||
"integrity": "sha512-B39/C/3YzfSbLgsf0sBpZILTSO8TIZVbh6tv3pXulG1qDL1tg41mLjp7M263MsC7ARzj7ME8WWsniBj0C4L+XA=="
|
||||
},
|
||||
"node_modules/@humanfs/core": {
|
||||
"version": "0.19.1",
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
"license": "ISC",
|
||||
"description": "",
|
||||
"dependencies": {
|
||||
"@gxc-solutions/math": "^0.0.2"
|
||||
"@gxc-solutions/math": "^0.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3.3.4",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue