@leafer-ui/display 2.1.10 → 2.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/display",
3
- "version": "2.1.10",
3
+ "version": "2.1.11",
4
4
  "description": "@leafer-ui/display",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,14 +22,14 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/core": "2.1.10",
26
- "@leafer-ui/data": "2.1.10",
27
- "@leafer-ui/display-module": "2.1.10",
28
- "@leafer-ui/decorator": "2.1.10",
29
- "@leafer-ui/external": "2.1.10"
25
+ "@leafer/core": "2.1.11",
26
+ "@leafer-ui/data": "2.1.11",
27
+ "@leafer-ui/display-module": "2.1.11",
28
+ "@leafer-ui/decorator": "2.1.11",
29
+ "@leafer-ui/external": "2.1.11"
30
30
  },
31
31
  "devDependencies": {
32
- "@leafer/interface": "2.1.10",
33
- "@leafer-ui/interface": "2.1.10"
32
+ "@leafer/interface": "2.1.11",
33
+ "@leafer-ui/interface": "2.1.11"
34
34
  }
35
35
  }
package/src/Line.ts CHANGED
@@ -34,6 +34,8 @@ export class Line<TInputData = ILineInputData> extends UI<TInputData> implements
34
34
  @pathType(false)
35
35
  declare public closed?: boolean
36
36
 
37
+ public get isPointsMode(): boolean { return this.points && !this.pathInputed }
38
+
37
39
  public get toPoint(): IPointData {
38
40
  const { width, rotation } = this.__
39
41
  const to: IPointData = getPointData()
package/src/Polygon.ts CHANGED
@@ -31,6 +31,7 @@ export class Polygon<TInputData = IPolygonInputData> extends UI<TInputData> impl
31
31
  @pathType(0)
32
32
  public curve?: boolean | number
33
33
 
34
+ public get isPointsMode(): boolean { return this.points && !this.pathInputed }
34
35
 
35
36
  public __updatePath(): void {
36
37
 
package/src/UI.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ILeaferCanvas, IRenderOptions, IPathDrawer, IPathCommandData, IHitType, INumber, IBoolean, IString, IPathString, IExportFileType, IPointData, ICursorType, IMaskType, IEraserType, IWindingRule, IPathCreator, IFourNumber, IBoundsData, IFlowType, IGap, IFlowWrap, IAxis, IConstraint, IAutoBoxData, IFlowBoxType, IPointGap, IFlowAlign, IFlowAxisAlign, IFindCondition, IAutoSize, IRangeSize, IAlign, IUnitPointData, IObject, IScaleData, IUnitData, IPathCommandObject, ITransition, IFilter, IScaleFixed, IDragBoundsType, IPathCommandNode } from '@leafer/interface'
2
2
  import { Leaf, PathDrawer, surfaceType, dimType, dataType, positionType, scrollType, boundsType, pathType, scaleType, rotationType, opacityType, visibleType, sortType, maskType, dataProcessor, registerUI, useModule, rewriteAble, UICreator, PathCorner, hitType, strokeType, PathConvert, eraserType, cursorType, autoLayoutType, pen, naturalBoundsType, pathInputType, MathHelper, Plugin, DataHelper, affectRenderBoundsType, isString, isNumber } from '@leafer/core'
3
3
 
4
- import { IUI, IShadowEffect, IBlurEffect, IStrokeAlign, IStrokeJoin, IStrokeCap, IBlendMode, IDashPatternString, IShadowString, IGrayscaleEffect, IUIData, IGroup, IStrokeWidthString, ICornerRadiusString, IUIInputData, IExportOptions, IExportResult, IFill, IStroke, IArrowStyle, IFindUIMethod, ILeafer, IEditorConfig, IEditorConfigFunction, IEditToolFunction, IKeyframe, IAnimation, IAnimate, IStates, IStateName, IAnimateType, IStateStyle, IColorString, IAnimateList, ILeafPaint, ILinker, IPathCommandDataWithRadius } from '@leafer-ui/interface'
4
+ import { IUI, IShadowEffect, IBlurEffect, IStrokeAlign, IStrokeJoin, IStrokeCap, IBlendMode, IDashPatternString, IShadowString, IGrayscaleEffect, IUIData, IGroup, IStrokeWidthString, ICornerRadiusString, IUIInputData, IExportOptions, IExportResult, IFill, IStroke, IArrowStyle, IFindUIMethod, ILeafer, IEditorConfig, IEditorConfigFunction, IEditToolFunction, IKeyframe, IAnimation, IAnimate, IStates, IStateName, IAnimateType, IStateStyle, IColorString, IAnimateList, ILeafPaint, ILinker, IPathCommandDataWithRadius, ILineData } from '@leafer-ui/interface'
5
5
  import { effectType, zoomLayerType } from '@leafer-ui/decorator'
6
6
 
7
7
  import { UIData } from '@leafer-ui/data'
@@ -487,8 +487,9 @@ export class UI<TInputData = IUIInputData> extends Leaf<TInputData> implements I
487
487
  }
488
488
 
489
489
  public __drawPath(canvas: ILeaferCanvas): void {
490
+ const data = this.__ as ILineData
490
491
  canvas.beginPath()
491
- this.__drawPathByData(canvas, this.__.path, true)
492
+ data.__usePointsMode ? PathDrawer.drawPathByPoints(canvas, data.points, data.closed) : this.__drawPathByData(canvas, data.path, true)
492
493
  }
493
494
 
494
495
  public __drawPathByData(drawer: IPathDrawer, data: IPathCommandData, ignoreCornerRadius?: boolean): void {
package/types/index.d.ts CHANGED
@@ -352,6 +352,7 @@ declare class Polygon<TInputData = IPolygonInputData> extends UI<TInputData> imp
352
352
  startAngle?: INumber;
353
353
  points?: number[] | IPointData[];
354
354
  curve?: boolean | number;
355
+ get isPointsMode(): boolean;
355
356
  __updatePath(): void;
356
357
  }
357
358
 
@@ -372,6 +373,7 @@ declare class Line<TInputData = ILineInputData> extends UI<TInputData> implement
372
373
  points?: number[] | IPointData[];
373
374
  curve?: boolean | number;
374
375
  closed?: boolean;
376
+ get isPointsMode(): boolean;
375
377
  get toPoint(): IPointData;
376
378
  set toPoint(value: IPointData);
377
379
  __updatePath(): void;