@visactor/vrender-kits
Advanced tools
Comparing version 0.21.9-alpha.0 to 0.21.9-alpha.1
@@ -1,2 +0,2 @@ | ||
import type { IContext2d, IContributionProvider, IDrawContext, IGraphicAttribute, IGraphicRender, IImageRenderContribution, IMarkAttribute, IRenderService, IThemeAttribute } from '@visactor/vrender-core'; | ||
import type { IContext2d, IContributionProvider, IDrawContext, IGraphicAttribute, IGraphicRender, IGraphicRenderDrawParams, IImageRenderContribution, IMarkAttribute, IRenderService, IThemeAttribute } from '@visactor/vrender-core'; | ||
import { BaseRenderContributionTime, DefaultCanvasImageRender, DefaultRectRenderContribution } from '@visactor/vrender-core'; | ||
@@ -9,2 +9,3 @@ import type { IGifImage } from '../../../interface/gif-image'; | ||
constructor(imageRenderContribitions: IContributionProvider<IImageRenderContribution>); | ||
drawShape(image: IGifImage, context: IContext2d, x: number, y: number, drawContext: IDrawContext, params?: IGraphicRenderDrawParams, fillCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean): void; | ||
draw(image: IGifImage, renderService: IRenderService, drawContext: IDrawContext): void; | ||
@@ -11,0 +12,0 @@ } |
@@ -27,2 +27,15 @@ "use strict"; | ||
} | ||
drawShape(image, context, x, y, drawContext, params, fillCb, strokeCb) { | ||
const imageAttribute = (0, vrender_core_1.getTheme)(image).image, {x: originX = imageAttribute.x, y: originY = imageAttribute.y, fillStrokeOrder: fillStrokeOrder = imageAttribute.fillStrokeOrder} = image.attribute, data = this.valid(image, imageAttribute, fillCb); | ||
if (!data) return; | ||
const {fVisible: fVisible, sVisible: sVisible, doFill: doFill, doStroke: doStroke} = data, _runFill = () => { | ||
doFill && fillCb && fillCb(context, image.attribute, imageAttribute); | ||
}, _runStroke = () => { | ||
doStroke && (strokeCb ? strokeCb(context, image.attribute, imageAttribute) : sVisible && (context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute), | ||
context.stroke())); | ||
}; | ||
fillStrokeOrder ? (_runStroke(), context.save(), context.clip(), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb), | ||
_runFill(), context.restore()) : (context.save(), context.clip(), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb), | ||
_runFill(), context.restore(), _runStroke()), this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb); | ||
} | ||
draw(image, renderService, drawContext) { | ||
@@ -29,0 +42,0 @@ const {context: context} = renderService.drawParams; |
@@ -1,2 +0,2 @@ | ||
import type { IContext2d, IContributionProvider, IDrawContext, IGraphicAttribute, IGraphicRender, IImageRenderContribution, IMarkAttribute, IRenderService, IThemeAttribute } from '@visactor/vrender-core'; | ||
import type { IContext2d, IContributionProvider, IDrawContext, IGraphicAttribute, IGraphicRender, IGraphicRenderDrawParams, IImageRenderContribution, IMarkAttribute, IRenderService, IThemeAttribute } from '@visactor/vrender-core'; | ||
import { BaseRenderContributionTime, DefaultCanvasImageRender, DefaultRectRenderContribution } from '@visactor/vrender-core'; | ||
@@ -9,2 +9,3 @@ import type { IGifImage } from '../../../interface/gif-image'; | ||
constructor(imageRenderContribitions: IContributionProvider<IImageRenderContribution>); | ||
drawShape(image: IGifImage, context: IContext2d, x: number, y: number, drawContext: IDrawContext, params?: IGraphicRenderDrawParams, fillCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean): void; | ||
draw(image: IGifImage, renderService: IRenderService, drawContext: IDrawContext): void; | ||
@@ -11,0 +12,0 @@ } |
@@ -23,2 +23,15 @@ var __decorate = this && this.__decorate || function(decorators, target, key, desc) { | ||
} | ||
drawShape(image, context, x, y, drawContext, params, fillCb, strokeCb) { | ||
const imageAttribute = getTheme(image).image, {x: originX = imageAttribute.x, y: originY = imageAttribute.y, fillStrokeOrder: fillStrokeOrder = imageAttribute.fillStrokeOrder} = image.attribute, data = this.valid(image, imageAttribute, fillCb); | ||
if (!data) return; | ||
const {fVisible: fVisible, sVisible: sVisible, doFill: doFill, doStroke: doStroke} = data, _runFill = () => { | ||
doFill && fillCb && fillCb(context, image.attribute, imageAttribute); | ||
}, _runStroke = () => { | ||
doStroke && (strokeCb ? strokeCb(context, image.attribute, imageAttribute) : sVisible && (context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute), | ||
context.stroke())); | ||
}; | ||
fillStrokeOrder ? (_runStroke(), context.save(), context.clip(), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb), | ||
_runFill(), context.restore()) : (context.save(), context.clip(), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb), | ||
_runFill(), context.restore(), _runStroke()), this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb); | ||
} | ||
draw(image, renderService, drawContext) { | ||
@@ -25,0 +38,0 @@ const {context: context} = renderService.drawParams; |
{ | ||
"name": "@visactor/vrender-kits", | ||
"version": "0.21.9-alpha.0", | ||
"version": "0.21.9-alpha.1", | ||
"description": "", | ||
@@ -16,3 +16,3 @@ "sideEffects": false, | ||
"@visactor/vutils": "~0.19.3", | ||
"@visactor/vrender-core": "0.21.9-alpha.0", | ||
"@visactor/vrender-core": "0.21.9-alpha.1", | ||
"@resvg/resvg-js": "2.4.1", | ||
@@ -19,0 +19,0 @@ "roughjs": "4.5.2", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
2493905
26482
+ Added@visactor/vrender-core@0.21.9-alpha.1(transitive)
- Removed@visactor/vrender-core@0.21.9-alpha.0(transitive)