@leafer-ui/display
Advanced tools
Comparing version
{ | ||
"name": "@leafer-ui/display", | ||
"version": "1.0.0-alpha.7", | ||
"version": "1.0.0-alpha.9", | ||
"description": "@leafer-ui/display", | ||
@@ -22,11 +22,11 @@ "author": "Chao (Leafer) Wan", | ||
"dependencies": { | ||
"@leafer/core": "1.0.0-alpha.7", | ||
"@leafer-ui/data": "1.0.0-alpha.7", | ||
"@leafer-ui/display-module": "1.0.0-alpha.7", | ||
"@leafer-ui/decorator": "1.0.0-alpha.7" | ||
"@leafer/core": "1.0.0-alpha.9", | ||
"@leafer-ui/data": "1.0.0-alpha.9", | ||
"@leafer-ui/display-module": "1.0.0-alpha.9", | ||
"@leafer-ui/decorator": "1.0.0-alpha.9" | ||
}, | ||
"devDependencies": { | ||
"@leafer/interface": "1.0.0-alpha.7", | ||
"@leafer-ui/interface": "1.0.0-alpha.7" | ||
"@leafer/interface": "1.0.0-alpha.9", | ||
"@leafer-ui/interface": "1.0.0-alpha.9" | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
import { __Number } from '@leafer/interface' | ||
import { PathCreator, OneRadian, dataProcessor, pathType, registerUI } from '@leafer/core' | ||
@@ -9,2 +10,3 @@ | ||
const { PI } = Math | ||
@@ -21,9 +23,9 @@ const { begin, moveTo, close, ellipse } = PathCreator | ||
@pathType(0) | ||
public innerRadius: number | ||
public innerRadius: __Number | ||
@pathType(0) | ||
public startAngle: number | ||
public startAngle: __Number | ||
@pathType(0) | ||
public endAngle: number | ||
public endAngle: __Number | ||
@@ -30,0 +32,0 @@ constructor(data?: IEllipseInputData) { |
@@ -1,2 +0,2 @@ | ||
import { ILeaferCanvas, IRenderOptions, ICanvasDrawPath, IBoundsData, IPathCommandData } from '@leafer/interface' | ||
import { ILeaferCanvas, IRenderOptions, IPathDrawer, IBoundsData, IPathCommandData, __Boolean } from '@leafer/interface' | ||
import { BoundsHelper, dataProcessor, boundsType, rewrite, useModule, rewriteAble, registerUI } from '@leafer/core' | ||
@@ -27,3 +27,3 @@ | ||
@boundsType(true) | ||
public clip: boolean | ||
public clip: __Boolean | ||
@@ -37,3 +37,3 @@ constructor(data?: IFrameInputData) { | ||
@rewrite(rect.__drawPathByData) | ||
public __drawPathByData(_drawer: ICanvasDrawPath, _data: IPathCommandData): void { } | ||
public __drawPathByData(_drawer: IPathDrawer, _data: IPathCommandData): void { } | ||
@@ -40,0 +40,0 @@ public __updateBoxBounds(): void { |
@@ -24,8 +24,2 @@ import { Branch, useModule, dataProcessor, registerUI } from '@leafer/core' | ||
public __updatePath(): void { | ||
} | ||
public add(_child: IUI, _index?: number): void { } // Branch rewrite | ||
public addAt(child: IUI, index: number): void { | ||
@@ -43,4 +37,8 @@ this.add(child, index) | ||
public remove(_child?: IUI): void { } // Branch rewrite | ||
// Branch rewrite | ||
public add(_child: IUI, _index?: number): void { } | ||
public remove(_child?: IUI): void { } | ||
} |
@@ -0,1 +1,2 @@ | ||
import { __String } from '@leafer/interface' | ||
import { boundsType, dataProcessor, registerUI } from '@leafer/core' | ||
@@ -16,6 +17,6 @@ | ||
@boundsType('') | ||
public url: string | ||
public url: __String | ||
@boundsType('') | ||
public thumb: string | ||
public thumb: __String | ||
@@ -22,0 +23,0 @@ constructor(data?: IImageInputData) { |
@@ -1,2 +0,2 @@ | ||
import { __Number, IPointData, ITwoPointBoundsData } from '@leafer/interface' | ||
import { IPointData, ITwoPointBoundsData, __Number } from '@leafer/interface' | ||
import { PathCreator, PointHelper, TwoPointBoundsHelper, boundsType, dataProcessor, registerUI } from '@leafer/core' | ||
@@ -26,16 +26,13 @@ | ||
protected __toPoint: IPointData | ||
protected __to: IPointData | ||
public get toPoint(): IPointData { | ||
if (this.__to && !this.__layout.boxBoundsChanged) return this.__to | ||
if (this.__toPoint && !this.__layout.boxBoundsChanged) return this.__toPoint | ||
const { width, height, rotation } = this.__ | ||
const { width, rotation } = this.__ | ||
const to: IPointData = { x: 0, y: 0 } | ||
if (width) to.x = width | ||
if (height) to.y = height | ||
if (rotation) rotate(to, rotation) | ||
this.__to = to | ||
this.__toPoint = to | ||
@@ -68,3 +65,3 @@ return to | ||
setPoint(pointBounds, 0, 0) | ||
addPoint(pointBounds, this.__to.x, this.__to.y) | ||
addPoint(pointBounds, this.__toPoint.x, this.__toPoint.y) | ||
toBounds(pointBounds, this.__layout.boxBounds) | ||
@@ -71,0 +68,0 @@ } |
@@ -1,5 +0,5 @@ | ||
import { ITwoPointBoundsData, ILeaferCanvas, IPathCommandData } from '@leafer/interface' | ||
import { ITwoPointBoundsData, ILeaferCanvas, IPathCommandData, IWindingRule } from '@leafer/interface' | ||
import { PathHelper, TwoPointBoundsHelper, dataProcessor, pathType, registerUI } from '@leafer/core' | ||
import { IPath, IPathData, IPathInputData, IWindingRule, IPathString } from '@leafer-ui/interface' | ||
import { IPath, IPathData, IPathInputData, IPathString } from '@leafer-ui/interface' | ||
import { PathData } from '@leafer-ui/data' | ||
@@ -6,0 +6,0 @@ |
@@ -0,1 +1,2 @@ | ||
import { __Number } from '@leafer/interface' | ||
import { PathCreator, dataProcessor, pathType, registerUI } from '@leafer/core' | ||
@@ -2,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { ICanvasDrawPath, IPathCommandData } from '@leafer/interface' | ||
import { IPathDrawer, IPathCommandData, __Number } from '@leafer/interface' | ||
import { dataProcessor, registerUI, useModule } from '@leafer/core' | ||
@@ -22,8 +22,6 @@ | ||
public __updatePath(): void { } | ||
public __drawPathByData(drawer: ICanvasDrawPath, _data: IPathCommandData): void { | ||
const { width, height, borderRadius } = this.__ | ||
if (borderRadius) { | ||
drawer.roundRect(0, 0, width, height, borderRadius) | ||
public __drawPathByData(drawer: IPathDrawer, _data: IPathCommandData): void { | ||
const { width, height, cornerRadius } = this.__ | ||
if (cornerRadius) { | ||
drawer.roundRect(0, 0, width, height, cornerRadius) | ||
} else { | ||
@@ -30,0 +28,0 @@ drawer.rect(0, 0, width, height) |
@@ -0,1 +1,2 @@ | ||
import { __Number } from '@leafer/interface' | ||
import { PathCreator, dataProcessor, pathType, registerUI } from '@leafer/core' | ||
@@ -20,6 +21,6 @@ | ||
@pathType(5) | ||
public points: number | ||
public points: __Number | ||
@pathType(0.38) | ||
public innerRadius: number | ||
public innerRadius: __Number | ||
@@ -26,0 +27,0 @@ constructor(data?: IStarInputData) { |
@@ -1,2 +0,2 @@ | ||
import { ICanvasDrawPath, IPathCommandData } from '@leafer/interface' | ||
import { IPathDrawer, IPathCommandData, __Boolean, __Number, __String } from '@leafer/interface' | ||
import { Platform, boundsType, dataProcessor, registerUI, useModule } from '@leafer/core' | ||
@@ -19,9 +19,9 @@ | ||
@boundsType('') | ||
public content: string | ||
public content: __String | ||
@boundsType('arial') | ||
public fontFamily: string | ||
public fontFamily: __String | ||
@boundsType(12) | ||
public fontSize: number | ||
public fontSize: __Number | ||
@@ -32,3 +32,3 @@ @boundsType('normal') | ||
@boundsType(false) | ||
public italic: boolean | ||
public italic: __Boolean | ||
@@ -42,12 +42,12 @@ @boundsType('normal') | ||
@boundsType() | ||
public letterSpacing: number | IPercent | ||
public letterSpacing: __Number | IPercent | ||
@boundsType() | ||
public lineHeight: number | IPercent | ||
public lineHeight: __Number | IPercent | ||
@boundsType() | ||
public paragraphIndent: number | ||
public paragraphIndent: __Number | ||
@boundsType() | ||
public paragraphSpacing: number | ||
public paragraphSpacing: __Number | ||
@@ -58,7 +58,3 @@ constructor(data?: ITextInputData) { | ||
public __updatePath(): void { | ||
} | ||
public __drawPathByData(drawer: ICanvasDrawPath, _data: IPathCommandData): void { | ||
public __drawPathByData(drawer: IPathDrawer, _data: IPathCommandData): void { | ||
const { width, height } = this.__ | ||
@@ -65,0 +61,0 @@ drawer.rect(0, 0, width, height) |
@@ -1,5 +0,5 @@ | ||
import { ILeaferCanvas, ICanvasDrawPath, IPathCommandData, __Number, __Boolean, __String, IMatrixData, IBoundsData } from '@leafer/interface' | ||
import { ILeaferCanvas, IPathDrawer, IPathCommandData, IMatrixData, IBoundsData, __Number, __Boolean, __String } from '@leafer/interface' | ||
import { Leaf, PathHelper, affectEventBoundsType, surfaceType, dataType, positionType, boundsType, pathType, scaleType, rotationType, opacityType, sortType, dataProcessor, useModule, rewrite, rewriteAble } from '@leafer/core' | ||
import { IUI, IShadowEffect, IBlurEffect, IPaint, IStrokeAlign, IStrokeJoin, IStrokeCap, IBlendMode, IPaintString, IDashPatternString, IShadowString, IGrayscaleEffect, IUIData, IGroup, IBorderWidthString, IBorderRadiusString } from '@leafer-ui/interface' | ||
import { IUI, IShadowEffect, IBlurEffect, IPaint, IStrokeAlign, IStrokeJoin, IStrokeCap, IBlendMode, IPaintString, IDashPatternString, IShadowString, IGrayscaleEffect, IUIData, IGroup, IStrokeWidthString, ICornerRadiusString } from '@leafer-ui/interface' | ||
import { effectType } from '@leafer-ui/decorator' | ||
@@ -103,11 +103,2 @@ | ||
// border | ||
@pathType() | ||
public borderRadius: __Number | __Number[] | IBorderRadiusString | ||
@affectEventBoundsType(1) | ||
public borderWidth: __Number | __Number[] | IBorderWidthString | ||
// stroke | ||
@@ -122,3 +113,3 @@ | ||
@affectEventBoundsType(1) | ||
public strokeWidth: __Number | ||
public strokeWidth: number | number[] | IStrokeWidthString | ||
@@ -144,3 +135,3 @@ @surfaceType('none') | ||
@pathType() | ||
public cornerRadius: __Number | ||
public cornerRadius: number | number[] | ICornerRadiusString | ||
@@ -182,5 +173,6 @@ @pathType() | ||
public __updateRenderPath(): void { | ||
const { __: data } = this | ||
const { cornerRadius, path } = data | ||
data.__renderPath = cornerRadius && path ? PathHelper.applyCorner(path, cornerRadius, data.cornerSmoothing) : path | ||
if (this.__.path) { | ||
const { __: data } = this | ||
data.__pathForRender = data.cornerRadius ? PathHelper.smoothCorner(data.path, data.cornerRadius, data.cornerSmoothing) : data.path | ||
} | ||
} | ||
@@ -190,3 +182,3 @@ | ||
canvas.beginPath() | ||
this.__drawPathByData(canvas, this.__.__renderPath) | ||
this.__drawPathByData(canvas, this.__.__pathForRender) | ||
} | ||
@@ -200,4 +192,4 @@ | ||
@rewrite(PathHelper.drawData) | ||
public __drawPathByData(_drawer: ICanvasDrawPath, _data: IPathCommandData): void { } | ||
public __drawPathByData(_drawer: IPathDrawer, _data: IPathCommandData): void { } | ||
} |
20832
-0.17%499
-0.99%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated