canvas-editor-engine 1.0.42 → 1.0.44

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,8 @@
1
1
  import type { IDrawImageArgs, IFilterOptions, IImageOptions } from "../types/image";
2
2
  export default class DrawService {
3
+ static scImage: SCImage;
3
4
  static drawImage(ctx: CanvasRenderingContext2D, src: string, options: IDrawImageArgs): void;
4
- static drawSmoothImage(useStore: boolean, ctx: CanvasRenderingContext2D, src: string, options: IDrawImageArgs, filterOptions: IFilterOptions): void;
5
+ static drawSmoothImage(useStore: boolean, options: IDrawImageArgs, filterOptions: IFilterOptions): void;
5
6
  private static getFilterArgs;
6
7
  }
7
8
  export declare class SCImage {
@@ -5,14 +5,14 @@ const config_1 = require("../config");
5
5
  const filters_1 = require("../filters");
6
6
  const store_1 = require("../store/store");
7
7
  class DrawService {
8
+ static scImage;
8
9
  static drawImage(ctx, src, options) {
9
- const img = new SCImage(src, ctx);
10
- img.draw(options);
10
+ DrawService.scImage = new SCImage(src, ctx);
11
+ DrawService.scImage.draw(options);
11
12
  }
12
- static drawSmoothImage(useStore, ctx, src, options, filterOptions) {
13
- const img = new SCImage(src, ctx);
13
+ static drawSmoothImage(useStore, options, filterOptions) {
14
14
  const filterArgs = DrawService.getFilterArgs(useStore, options);
15
- img.draw(options).then(() => img.vague(filterArgs, filterOptions));
15
+ this.scImage.vague(filterArgs, filterOptions);
16
16
  }
17
17
  static getFilterArgs(useStore, options) {
18
18
  let filterArgs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canvas-editor-engine",
3
- "version": "1.0.42",
3
+ "version": "1.0.44",
4
4
  "description": "CanvasEditorEngine library, use: [typescript] [canvas]",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",