@visactor/vrender-core 0.21.5-alpha.1 → 0.21.5
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/cjs/animate/custom-animate.js +1 -2
- package/cjs/canvas/empty-context.js +2 -1
- package/cjs/common/3d-interceptor.js +1 -2
- package/cjs/common/color-utils.js +1 -1
- package/cjs/common/contribution-provider.js +1 -1
- package/cjs/common/custom-path2d.js +1 -1
- package/cjs/common/enums.js +1 -1
- package/cjs/common/generator.js +1 -1
- package/cjs/common/matrix.js +1 -1
- package/cjs/common/morphing-utils.js +1 -1
- package/cjs/common/path-svg.js +1 -1
- package/cjs/common/polygon.js +2 -2
- package/cjs/common/rect-utils.js +1 -1
- package/cjs/common/render-area.js +1 -1
- package/cjs/common/render-command-list.js +1 -2
- package/cjs/common/render-curve.js +1 -1
- package/cjs/common/render-utils.js +1 -1
- package/cjs/common/seg-context.js +1 -1
- package/cjs/common/simplify.js +1 -1
- package/cjs/common/sort.js +1 -1
- package/cjs/common/split-path.js +1 -1
- package/cjs/common/store.js +1 -1
- package/cjs/core/application.js +1 -1
- package/cjs/core/camera.js +1 -1
- package/cjs/core/constants.js +1 -1
- package/cjs/core/core-modules.js +1 -1
- package/cjs/core/global-module.js +2 -0
- package/cjs/core/global.js +1 -1
- package/cjs/core/graphic-utils.js +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/layer-service.js +1 -1
- package/cjs/core/layer.js +1 -1
- package/cjs/core/light.js +2 -1
- package/cjs/core/stage.js +1 -1
- package/cjs/core/window.js +1 -1
- package/cjs/event/constant.js +2 -1
- package/cjs/event/event-manager.js +1 -1
- package/cjs/event/event-system.js +1 -1
- package/cjs/event/event-target.js +1 -1
- package/cjs/event/index.js +1 -1
- package/cjs/event/util.js +1 -1
- package/cjs/render/contributions/render/contributions/image-contribution-render.d.ts +2 -6
- package/cjs/render/contributions/render/contributions/image-contribution-render.js +3 -48
- package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/image-render.js +12 -12
- package/cjs/render/contributions/render/image-render.js.map +1 -1
- package/dist/index.es.js +23 -113
- package/es/animate/custom-animate.js +1 -2
- package/es/canvas/empty-context.js +2 -1
- package/es/common/3d-interceptor.js +1 -2
- package/es/common/color-utils.js +1 -1
- package/es/common/contribution-provider.js +1 -1
- package/es/common/custom-path2d.js +1 -1
- package/es/common/enums.js +1 -1
- package/es/common/generator.js +1 -1
- package/es/common/matrix.js +1 -1
- package/es/common/morphing-utils.js +1 -1
- package/es/common/path-svg.js +1 -1
- package/es/common/polygon.js +1 -1
- package/es/common/rect-utils.js +1 -1
- package/es/common/render-area.js +1 -1
- package/es/common/render-command-list.js +1 -2
- package/es/common/render-curve.js +1 -1
- package/es/common/render-utils.js +1 -1
- package/es/common/seg-context.js +1 -1
- package/es/common/simplify.js +1 -1
- package/es/common/sort.js +1 -1
- package/es/common/split-path.js +1 -1
- package/es/common/store.js +1 -1
- package/es/core/application.js +1 -1
- package/es/core/camera.js +1 -1
- package/es/core/constants.js +1 -1
- package/es/core/core-modules.js +1 -1
- package/es/core/global-module.js +2 -0
- package/es/core/global.js +1 -1
- package/es/core/graphic-utils.js +1 -1
- package/es/core/index.js +1 -1
- package/es/core/layer-service.js +1 -1
- package/es/core/layer.js +1 -1
- package/es/core/light.js +2 -1
- package/es/core/stage.js +1 -1
- package/es/core/window.js +1 -1
- package/es/event/constant.js +2 -1
- package/es/event/event-manager.js +1 -1
- package/es/event/event-system.js +1 -1
- package/es/event/event-target.js +1 -1
- package/es/event/index.js +1 -1
- package/es/event/util.js +1 -1
- package/es/render/contributions/render/contributions/image-contribution-render.d.ts +2 -6
- package/es/render/contributions/render/contributions/image-contribution-render.js +2 -52
- package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/es/render/contributions/render/image-render.js +12 -12
- package/es/render/contributions/render/image-render.js.map +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -15980,96 +15980,6 @@ const defaultRectRenderContribution = new DefaultRectRenderContribution();
|
|
|
15980
15980
|
const defaultRectTextureRenderContribution = defaultBaseTextureRenderContribution;
|
|
15981
15981
|
const defaultRectBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
|
|
15982
15982
|
|
|
15983
|
-
class DefaultImageBackgroundRenderContribution extends DefaultBaseBackgroundRenderContribution {
|
|
15984
|
-
constructor() {
|
|
15985
|
-
super(...arguments);
|
|
15986
|
-
this.time = BaseRenderContributionTime.beforeFillStroke;
|
|
15987
|
-
}
|
|
15988
|
-
drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
|
|
15989
|
-
const { background, backgroundMode = graphicAttribute.backgroundMode, backgroundFit = graphicAttribute.backgroundFit, width, height } = graphic.attribute;
|
|
15990
|
-
if (!background) {
|
|
15991
|
-
return;
|
|
15992
|
-
}
|
|
15993
|
-
if (!graphic.backgroundImg) {
|
|
15994
|
-
if (isObject(background)) {
|
|
15995
|
-
const { stroke, fill, lineWidth = 1, cornerRadius = 0, expandX = 0, expandY = 0 } = background;
|
|
15996
|
-
if (!stroke && !fill) {
|
|
15997
|
-
return;
|
|
15998
|
-
}
|
|
15999
|
-
context.beginPath();
|
|
16000
|
-
const { x, y, width, height } = getActualPosition(graphic);
|
|
16001
|
-
if (cornerRadius) {
|
|
16002
|
-
createRectPath(context, x - expandX, y - expandY, width + expandX * 2, height + expandY * 2, cornerRadius);
|
|
16003
|
-
}
|
|
16004
|
-
else {
|
|
16005
|
-
context.rect(x - expandX, y - expandY, width + expandX * 2, height + expandY * 2);
|
|
16006
|
-
}
|
|
16007
|
-
context.globalAlpha = 1;
|
|
16008
|
-
if (fill) {
|
|
16009
|
-
context.fillStyle = fill;
|
|
16010
|
-
context.fill();
|
|
16011
|
-
}
|
|
16012
|
-
if (stroke && lineWidth > 0) {
|
|
16013
|
-
context.lineWidth = lineWidth;
|
|
16014
|
-
context.strokeStyle = stroke;
|
|
16015
|
-
context.stroke();
|
|
16016
|
-
}
|
|
16017
|
-
}
|
|
16018
|
-
else {
|
|
16019
|
-
context.beginPath();
|
|
16020
|
-
context.rect(x, y, width || 0, height || 0);
|
|
16021
|
-
context.fillStyle = background;
|
|
16022
|
-
context.globalAlpha = 1;
|
|
16023
|
-
context.fill();
|
|
16024
|
-
}
|
|
16025
|
-
}
|
|
16026
|
-
else {
|
|
16027
|
-
const res = graphic.resources.get(background);
|
|
16028
|
-
if (res.state !== 'success' || !res.data) {
|
|
16029
|
-
return;
|
|
16030
|
-
}
|
|
16031
|
-
context.save();
|
|
16032
|
-
if (graphic.parent && !graphic.transMatrix.onlyTranslate()) {
|
|
16033
|
-
const groupAttribute = getTheme(graphic.parent).group;
|
|
16034
|
-
const { scrollX = groupAttribute.scrollX, scrollY = groupAttribute.scrollY } = graphic.parent.attribute;
|
|
16035
|
-
context.setTransformFromMatrix(graphic.parent.globalTransMatrix, true);
|
|
16036
|
-
context.translate(scrollX, scrollY);
|
|
16037
|
-
}
|
|
16038
|
-
const b = graphic.AABBBounds;
|
|
16039
|
-
this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit);
|
|
16040
|
-
context.restore();
|
|
16041
|
-
if (!graphic.transMatrix.onlyTranslate()) {
|
|
16042
|
-
context.setTransformForCurrent();
|
|
16043
|
-
}
|
|
16044
|
-
}
|
|
16045
|
-
}
|
|
16046
|
-
}
|
|
16047
|
-
function getActualPosition(graphic) {
|
|
16048
|
-
const boundsPadding = parsePadding(graphic.attribute.boundsPadding);
|
|
16049
|
-
const bounds = graphic.AABBBounds;
|
|
16050
|
-
let x = bounds.x1;
|
|
16051
|
-
let y = bounds.y1;
|
|
16052
|
-
let width = bounds.width();
|
|
16053
|
-
let height = bounds.height();
|
|
16054
|
-
if (isNumber(boundsPadding)) {
|
|
16055
|
-
x += boundsPadding;
|
|
16056
|
-
y += boundsPadding;
|
|
16057
|
-
width -= boundsPadding * 2;
|
|
16058
|
-
height -= boundsPadding * 2;
|
|
16059
|
-
}
|
|
16060
|
-
else {
|
|
16061
|
-
x += boundsPadding[3];
|
|
16062
|
-
y += boundsPadding[0];
|
|
16063
|
-
width -= boundsPadding[1] + boundsPadding[3];
|
|
16064
|
-
height -= boundsPadding[0] + boundsPadding[2];
|
|
16065
|
-
}
|
|
16066
|
-
return {
|
|
16067
|
-
x,
|
|
16068
|
-
y,
|
|
16069
|
-
width,
|
|
16070
|
-
height
|
|
16071
|
-
};
|
|
16072
|
-
}
|
|
16073
15983
|
class DefaultImageRenderContribution extends DefaultRectRenderContribution {
|
|
16074
15984
|
constructor() {
|
|
16075
15985
|
super(...arguments);
|
|
@@ -16082,7 +15992,7 @@ class DefaultImageRenderContribution extends DefaultRectRenderContribution {
|
|
|
16082
15992
|
}
|
|
16083
15993
|
}
|
|
16084
15994
|
const defaultImageRenderContribution = new DefaultImageRenderContribution();
|
|
16085
|
-
const defaultImageBackgroundRenderContribution =
|
|
15995
|
+
const defaultImageBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
|
|
16086
15996
|
|
|
16087
15997
|
class DefaultSymbolRenderContribution {
|
|
16088
15998
|
constructor() {
|
|
@@ -18526,30 +18436,30 @@ let DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender
|
|
|
18526
18436
|
return;
|
|
18527
18437
|
}
|
|
18528
18438
|
const { fVisible, sVisible, doFill, doStroke } = data;
|
|
18529
|
-
|
|
18439
|
+
if (!url || !image.resources) {
|
|
18440
|
+
return;
|
|
18441
|
+
}
|
|
18442
|
+
const res = image.resources.get(url);
|
|
18443
|
+
if (res.state !== 'success') {
|
|
18444
|
+
return;
|
|
18445
|
+
}
|
|
18446
|
+
let needRestore = false;
|
|
18447
|
+
if (cornerRadius === 0 || (isArray(cornerRadius) && cornerRadius.every(num => num === 0))) ;
|
|
18448
|
+
else {
|
|
18449
|
+
context.beginPath();
|
|
18450
|
+
createRectPath(context, x, y, width, height, cornerRadius);
|
|
18451
|
+
context.save();
|
|
18452
|
+
context.clip();
|
|
18453
|
+
needRestore = true;
|
|
18454
|
+
}
|
|
18530
18455
|
this.beforeRenderStep(image, context, x, y, doFill, false, fVisible, false, imageAttribute, drawContext, fillCb);
|
|
18456
|
+
context.setShadowBlendStyle && context.setShadowBlendStyle(image, image.attribute, imageAttribute);
|
|
18531
18457
|
const _runFill = () => {
|
|
18532
18458
|
if (doFill) {
|
|
18533
18459
|
if (fillCb) {
|
|
18534
18460
|
fillCb(context, image.attribute, imageAttribute);
|
|
18535
18461
|
}
|
|
18536
18462
|
else if (fVisible) {
|
|
18537
|
-
if (!url || !image.resources) {
|
|
18538
|
-
return;
|
|
18539
|
-
}
|
|
18540
|
-
const res = image.resources.get(url);
|
|
18541
|
-
if (res.state !== 'success') {
|
|
18542
|
-
return;
|
|
18543
|
-
}
|
|
18544
|
-
let needRestore = false;
|
|
18545
|
-
if (cornerRadius === 0 || (isArray(cornerRadius) && cornerRadius.every(num => num === 0))) ;
|
|
18546
|
-
else {
|
|
18547
|
-
context.beginPath();
|
|
18548
|
-
createRectPath(context, x, y, width, height, cornerRadius);
|
|
18549
|
-
context.save();
|
|
18550
|
-
context.clip();
|
|
18551
|
-
needRestore = true;
|
|
18552
|
-
}
|
|
18553
18463
|
context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
|
|
18554
18464
|
let repeat = 0;
|
|
18555
18465
|
if (repeatX === 'repeat') {
|
|
@@ -18568,9 +18478,6 @@ let DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender
|
|
|
18568
18478
|
else {
|
|
18569
18479
|
context.drawImage(res.data, x, y, width, height);
|
|
18570
18480
|
}
|
|
18571
|
-
if (needRestore) {
|
|
18572
|
-
context.restore();
|
|
18573
|
-
}
|
|
18574
18481
|
}
|
|
18575
18482
|
}
|
|
18576
18483
|
};
|
|
@@ -18581,7 +18488,7 @@ let DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender
|
|
|
18581
18488
|
}
|
|
18582
18489
|
else if (sVisible) {
|
|
18583
18490
|
context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute);
|
|
18584
|
-
context.
|
|
18491
|
+
context.stroke();
|
|
18585
18492
|
}
|
|
18586
18493
|
}
|
|
18587
18494
|
};
|
|
@@ -18594,6 +18501,9 @@ let DefaultCanvasImageRender = class DefaultCanvasImageRender extends BaseRender
|
|
|
18594
18501
|
_runFill();
|
|
18595
18502
|
}
|
|
18596
18503
|
this.afterRenderStep(image, context, x, y, doFill, false, fVisible, false, imageAttribute, drawContext, fillCb);
|
|
18504
|
+
if (needRestore) {
|
|
18505
|
+
context.restore();
|
|
18506
|
+
}
|
|
18597
18507
|
}
|
|
18598
18508
|
draw(image, renderService, drawContext) {
|
|
18599
18509
|
const { image: url } = image.attribute;
|
|
@@ -28809,4 +28719,4 @@ const registerFlexLayoutPlugin = () => {
|
|
|
28809
28719
|
Factory.registerPlugin('FlexLayoutPlugin', FlexLayoutPlugin);
|
|
28810
28720
|
};
|
|
28811
28721
|
|
|
28812
|
-
export { ACustomAnimate, ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AbstractGraphicRender, Animate, AnimateGroup, AnimateGroup1, AnimateMode, AnimateStatus, AnimateStepType, Application, Arc, Arc3d, Arc3dRender, ArcRender, ArcRenderContribution, Area, AreaRender, AreaRenderContribution, AttributeAnimate, AttributeUpdateType, AutoEnablePlugins, BaseCanvas, BaseEnvContribution, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasFactory, CanvasTextLayout, CbAnimate, Circle, CircleRender, CircleRenderContribution, ClipAngleAnimate, ClipDirectionAnimate, ClipGraphicAnimate, ClipRadiusAnimate, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, Container, ContainerModule, Context2dFactory, ContributionProvider, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DEFAULT_TEXT_FONT_FAMILY, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasGroupRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageBackgroundRenderContribution, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultMorphingAnimateConfig, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStateAnimateConfig, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTicker, DefaultTimeline, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction$1 as Direction, DirectionalLight, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Edge, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FadeInPlus, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, GlobalPickerService, Glyph, GlyphRender, Graphic, GraphicAnimate, GraphicCreator$1 as GraphicCreator, GraphicPicker, GraphicRender, GraphicService, GraphicUtil, Group, GroupFadeIn, GroupFadeOut, GroupRender, GroupRenderContribution, GroupUpdateAABBBoundsMode, HtmlAttributePlugin, IContainPointMode, IMAGE_NUMBER_TYPE, Image, ImageRender, ImageRenderContribution, IncreaseCount, IncrementalDrawContribution, InputText, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LINE_NUMBER_TYPE, Layer, LayerService, Line$1 as Line, LineRender, Linear, LinearClosed, ManualTickHandler, ManualTicker, Mat4Allocate, MatrixAllocate, MeasureModeEnum, Meteor, MonotoneX, MonotoneY, MorphingPath, MotionPath, MultiToOneMorphingPath, NOWORK_ANIMATE_ATTR, Node, OrthoCamera, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Path, PathRender, PathRenderContribution, PickItemInterceptor, PickerService, PluginService, Polygon, PolygonRender, PolygonRenderContribution, Pyramid3d, Pyramid3dRender, RAFTickHandler, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, RafBasedSTO, ReactAttributePlugin, Rect, Rect3DRender, Rect3d, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, ResourceLoader, RichText, RichTextEditPlugin, RichTextRender, RotateBySphereAnimate, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, SegContext, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StaticLayerHandlerContribution, Step$1 as Step, StreamLight, SubAnimate, Symbol$1 as Symbol, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, TagPointsUpdate, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, TimeOutTickHandler, TransformUtil, UpdateTag, VGlobal, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _calculateLineHeight, _interpolateColor, addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindContributionProvider, bindContributionProviderNoSingletonScope, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleModule, clock, cloneGraphic, colorEqual, colorStringInterpolationToStr, container, cornerTangents, createArc, createArc3d, createArea, createCircle, createColor, createConicalGradient, createGlyph, createGroup, createImage, createLine, createMat4, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, defaultTicker, defaultTimeline, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawIncrementalAreaSegments, drawIncrementalSegments, drawPathProxy, drawSegments, enumCommandMap, fillVisible, findBestMorphingRotation, findNextGraphic, flatten_simplify, foreach, foreachAsync, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepSegments, genStepTypeSegments, getAttributeFromDefaultAttrList, getConicGradientAt, getCurrentEnv, getExtraModelMatrix, getModelMatrix, getRichTextBounds, getScaledStroke, getTextBounds, getTheme, getThemeFromGroup, globalTheme, glyphModule, graphicCreator, graphicService, graphicUtil, identityMat4, imageModule, incrementalAddTo, inject, injectable, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, intersect, isBrowserEnv, isNodeEnv, isSvg, isTransformKey, isXML, layerService, lineModule, lookAt, mat3Tomat4, mat4Allocate, matrixAllocate, morphPath, multiInject, multiToOneMorph, multiplyMat4Mat3, multiplyMat4Mat4, named, newThemeObj, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonModule, preLoadAllModule, pyramid3dModule, rafBasedSto, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, registerArc3dGraphic, registerArcGraphic, registerAreaGraphic, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlyphGraphic, registerGroupGraphic, registerHtmlAttributePlugin, registerImageGraphic, registerLineGraphic, registerOrthoCamera, registerPathGraphic, registerPolygonGraphic, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect3dGraphic, registerRectGraphic, registerRichtextGraphic, registerShadowRootGraphic, registerSymbolGraphic, registerTextGraphic, registerViewTransform3dPlugin, registerWrapTextGraphic, renderCommandList, rewriteProto, richtextModule, rotateX, rotateY, rotateZ, runFill, runStroke, scaleMat4, segments, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitGraphic, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, strCommandMap, strokeVisible, symbolModule, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textModule, transformKeys, transformMat4, transformUtil, translate, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };
|
|
28722
|
+
export { ACustomAnimate, ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AbstractGraphicRender, Animate, AnimateGroup, AnimateGroup1, AnimateMode, AnimateStatus, AnimateStepType, Application, Arc, Arc3d, Arc3dRender, ArcRender, ArcRenderContribution, Area, AreaRender, AreaRenderContribution, AttributeAnimate, AttributeUpdateType, AutoEnablePlugins, BaseCanvas, BaseEnvContribution, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasFactory, CanvasTextLayout, CbAnimate, Circle, CircleRender, CircleRenderContribution, ClipAngleAnimate, ClipDirectionAnimate, ClipGraphicAnimate, ClipRadiusAnimate, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, Container, ContainerModule, Context2dFactory, ContributionProvider, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DEFAULT_TEXT_FONT_FAMILY, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasGroupRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultMorphingAnimateConfig, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStateAnimateConfig, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTicker, DefaultTimeline, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction$1 as Direction, DirectionalLight, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Edge, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FadeInPlus, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, GlobalPickerService, Glyph, GlyphRender, Graphic, GraphicAnimate, GraphicCreator$1 as GraphicCreator, GraphicPicker, GraphicRender, GraphicService, GraphicUtil, Group, GroupFadeIn, GroupFadeOut, GroupRender, GroupRenderContribution, GroupUpdateAABBBoundsMode, HtmlAttributePlugin, IContainPointMode, IMAGE_NUMBER_TYPE, Image, ImageRender, ImageRenderContribution, IncreaseCount, IncrementalDrawContribution, InputText, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LINE_NUMBER_TYPE, Layer, LayerService, Line$1 as Line, LineRender, Linear, LinearClosed, ManualTickHandler, ManualTicker, Mat4Allocate, MatrixAllocate, MeasureModeEnum, Meteor, MonotoneX, MonotoneY, MorphingPath, MotionPath, MultiToOneMorphingPath, NOWORK_ANIMATE_ATTR, Node, OrthoCamera, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Path, PathRender, PathRenderContribution, PickItemInterceptor, PickerService, PluginService, Polygon, PolygonRender, PolygonRenderContribution, Pyramid3d, Pyramid3dRender, RAFTickHandler, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, RafBasedSTO, ReactAttributePlugin, Rect, Rect3DRender, Rect3d, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, ResourceLoader, RichText, RichTextEditPlugin, RichTextRender, RotateBySphereAnimate, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, SegContext, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StaticLayerHandlerContribution, Step$1 as Step, StreamLight, SubAnimate, Symbol$1 as Symbol, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, TagPointsUpdate, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, TimeOutTickHandler, TransformUtil, UpdateTag, VGlobal, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _calculateLineHeight, _interpolateColor, addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindContributionProvider, bindContributionProviderNoSingletonScope, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleModule, clock, cloneGraphic, colorEqual, colorStringInterpolationToStr, container, cornerTangents, createArc, createArc3d, createArea, createCircle, createColor, createConicalGradient, createGlyph, createGroup, createImage, createLine, createMat4, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, defaultTicker, defaultTimeline, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawIncrementalAreaSegments, drawIncrementalSegments, drawPathProxy, drawSegments, enumCommandMap, fillVisible, findBestMorphingRotation, findNextGraphic, flatten_simplify, foreach, foreachAsync, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepSegments, genStepTypeSegments, getAttributeFromDefaultAttrList, getConicGradientAt, getCurrentEnv, getExtraModelMatrix, getModelMatrix, getRichTextBounds, getScaledStroke, getTextBounds, getTheme, getThemeFromGroup, globalTheme, glyphModule, graphicCreator, graphicService, graphicUtil, identityMat4, imageModule, incrementalAddTo, inject, injectable, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, intersect, isBrowserEnv, isNodeEnv, isSvg, isTransformKey, isXML, layerService, lineModule, lookAt, mat3Tomat4, mat4Allocate, matrixAllocate, morphPath, multiInject, multiToOneMorph, multiplyMat4Mat3, multiplyMat4Mat4, named, newThemeObj, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonModule, preLoadAllModule, pyramid3dModule, rafBasedSto, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, registerArc3dGraphic, registerArcGraphic, registerAreaGraphic, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlyphGraphic, registerGroupGraphic, registerHtmlAttributePlugin, registerImageGraphic, registerLineGraphic, registerOrthoCamera, registerPathGraphic, registerPolygonGraphic, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect3dGraphic, registerRectGraphic, registerRichtextGraphic, registerShadowRootGraphic, registerSymbolGraphic, registerTextGraphic, registerViewTransform3dPlugin, registerWrapTextGraphic, renderCommandList, rewriteProto, richtextModule, rotateX, rotateY, rotateZ, runFill, runStroke, scaleMat4, segments, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitGraphic, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, strCommandMap, strokeVisible, symbolModule, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textModule, transformKeys, transformMat4, transformUtil, translate, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };
|
|
@@ -215,4 +215,5 @@ let EmptyContext2d = class {
|
|
|
215
215
|
|
|
216
216
|
EmptyContext2d = __decorate([ injectable(), __metadata("design:paramtypes", [ Object, Number ]) ], EmptyContext2d);
|
|
217
217
|
|
|
218
|
-
export { EmptyContext2d };
|
|
218
|
+
export { EmptyContext2d };
|
|
219
|
+
//# sourceMappingURL=empty-context.js.map
|
package/es/common/color-utils.js
CHANGED
|
@@ -17,4 +17,4 @@ export function bindContributionProvider(bind, id) {
|
|
|
17
17
|
export function bindContributionProviderNoSingletonScope(bind, id) {
|
|
18
18
|
bind(ContributionProvider).toDynamicValue((({container: container}) => new ContributionProviderCache(id, container))).whenTargetNamed(id);
|
|
19
19
|
}
|
|
20
|
-
//# sourceMappingURL=contribution-provider.js.map
|
|
20
|
+
//# sourceMappingURL=contribution-provider.js.map
|
|
@@ -339,4 +339,4 @@ function scale(current, sX, sY) {
|
|
|
339
339
|
temp[7] = sY * current[7]; else if ("h" === c || "H" === c) temp[1] = sX * current[1]; else if ("v" === c || "V" === c) temp[1] = sY * current[1]; else for (let i = 1, n = current.length; i < n; ++i) temp[i] = (i % 2 == 1 ? sX : sY) * current[i];
|
|
340
340
|
return temp;
|
|
341
341
|
}
|
|
342
|
-
//# sourceMappingURL=custom-path2d.js.map
|
|
342
|
+
//# sourceMappingURL=custom-path2d.js.map
|
package/es/common/enums.js
CHANGED
|
@@ -70,4 +70,4 @@ export var BaseRenderContributionTime;
|
|
|
70
70
|
BaseRenderContributionTime[BaseRenderContributionTime.beforeFillStroke = 0] = "beforeFillStroke",
|
|
71
71
|
BaseRenderContributionTime[BaseRenderContributionTime.afterFillStroke = 1] = "afterFillStroke";
|
|
72
72
|
}(BaseRenderContributionTime || (BaseRenderContributionTime = {}));
|
|
73
|
-
//# sourceMappingURL=enums.js.map
|
|
73
|
+
//# sourceMappingURL=enums.js.map
|
package/es/common/generator.js
CHANGED
package/es/common/matrix.js
CHANGED
|
@@ -118,4 +118,4 @@ export function transformMat4(out, a, m) {
|
|
|
118
118
|
return w = w || 1, out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w, out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w,
|
|
119
119
|
out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w, out;
|
|
120
120
|
}
|
|
121
|
-
//# sourceMappingURL=matrix.js.map
|
|
121
|
+
//# sourceMappingURL=matrix.js.map
|
package/es/common/path-svg.js
CHANGED
package/es/common/polygon.js
CHANGED
package/es/common/rect-utils.js
CHANGED
package/es/common/render-area.js
CHANGED
package/es/common/seg-context.js
CHANGED
package/es/common/simplify.js
CHANGED
|
@@ -30,4 +30,4 @@ export function flatten_simplify(points, tolerance, highestQuality) {
|
|
|
30
30
|
if (points.length <= 10) return points;
|
|
31
31
|
return points = highestQuality ? points : simplifyRadialDist(points, void 0 !== tolerance ? tolerance * tolerance : 1);
|
|
32
32
|
}
|
|
33
|
-
//# sourceMappingURL=simplify.js.map
|
|
33
|
+
//# sourceMappingURL=simplify.js.map
|
package/es/common/sort.js
CHANGED
package/es/common/split-path.js
CHANGED
package/es/common/store.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
class StageStore {}
|
|
2
|
-
//# sourceMappingURL=store.js.map
|
|
2
|
+
//# sourceMappingURL=store.js.map
|
package/es/core/application.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const ApplicationContribution = Symbol("ApplicationContribution");
|
|
2
|
-
//# sourceMappingURL=application.js.map
|
|
2
|
+
//# sourceMappingURL=application.js.map
|
package/es/core/camera.js
CHANGED
package/es/core/constants.js
CHANGED
|
@@ -9,4 +9,4 @@ export const StaticLayerHandlerContribution = Symbol.for("StaticLayerHandlerCont
|
|
|
9
9
|
export const DynamicLayerHandlerContribution = Symbol.for("DynamicLayerHandlerContribution");
|
|
10
10
|
|
|
11
11
|
export const VirtualLayerHandlerContribution = Symbol.for("VirtualLayerHandlerContribution");
|
|
12
|
-
//# sourceMappingURL=constants.js.map
|
|
12
|
+
//# sourceMappingURL=constants.js.map
|
package/es/core/core-modules.js
CHANGED
|
@@ -17,4 +17,4 @@ export default new ContainerModule((bind => {
|
|
|
17
17
|
bind(GraphicUtil).to(DefaultGraphicUtil).inSingletonScope(), bind(TransformUtil).to(DefaultTransformUtil).inSingletonScope(),
|
|
18
18
|
bind(LayerService).to(DefaultLayerService).inSingletonScope();
|
|
19
19
|
}));
|
|
20
|
-
//# sourceMappingURL=core-modules.js.map
|
|
20
|
+
//# sourceMappingURL=core-modules.js.map
|
package/es/core/global-module.js
CHANGED
package/es/core/global.js
CHANGED
|
@@ -210,4 +210,4 @@ let DefaultGlobal = class {
|
|
|
210
210
|
DefaultGlobal = __decorate([ injectable(), __param(0, inject(ContributionProvider)), __param(0, named(EnvContribution)), __metadata("design:paramtypes", [ Object ]) ], DefaultGlobal);
|
|
211
211
|
|
|
212
212
|
export { DefaultGlobal };
|
|
213
|
-
//# sourceMappingURL=global.js.map
|
|
213
|
+
//# sourceMappingURL=global.js.map
|
package/es/core/graphic-utils.js
CHANGED
|
@@ -184,4 +184,4 @@ let DefaultTransformUtil = class {
|
|
|
184
184
|
DefaultTransformUtil = __decorate([ injectable(), __metadata("design:paramtypes", []) ], DefaultTransformUtil);
|
|
185
185
|
|
|
186
186
|
export { DefaultTransformUtil };
|
|
187
|
-
//# sourceMappingURL=graphic-utils.js.map
|
|
187
|
+
//# sourceMappingURL=graphic-utils.js.map
|
package/es/core/index.js
CHANGED
package/es/core/layer-service.js
CHANGED
|
@@ -83,4 +83,4 @@ DefaultLayerService.idprefix = "visactor_layer", DefaultLayerService.prefix_coun
|
|
|
83
83
|
DefaultLayerService = DefaultLayerService_1 = __decorate([ injectable(), __metadata("design:paramtypes", []) ], DefaultLayerService);
|
|
84
84
|
|
|
85
85
|
export { DefaultLayerService };
|
|
86
|
-
//# sourceMappingURL=layer-service.js.map
|
|
86
|
+
//# sourceMappingURL=layer-service.js.map
|
package/es/core/layer.js
CHANGED
package/es/core/light.js
CHANGED
package/es/core/stage.js
CHANGED
package/es/core/window.js
CHANGED
package/es/event/constant.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export const WILDCARD = "*";
|
|
1
|
+
export const WILDCARD = "*";
|
|
2
|
+
//# sourceMappingURL=constant.js.map
|
package/es/event/event-system.js
CHANGED
package/es/event/event-target.js
CHANGED
package/es/event/index.js
CHANGED
package/es/event/util.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const clock = "object" == typeof performance && performance.now ? performance : Date;
|
|
2
|
-
//# sourceMappingURL=util.js.map
|
|
2
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import type { IGraphicAttribute, IContext2d,
|
|
1
|
+
import type { IGraphicAttribute, IContext2d, IThemeAttribute, IImageRenderContribution, IDrawContext, IMarkAttribute } from '../../../../interface';
|
|
2
2
|
import { DefaultBaseBackgroundRenderContribution } from './base-contribution-render';
|
|
3
3
|
import { BaseRenderContributionTime } from '../../../../common/enums';
|
|
4
4
|
import { DefaultRectRenderContribution } from './rect-contribution-render';
|
|
5
|
-
export declare class DefaultImageBackgroundRenderContribution extends DefaultBaseBackgroundRenderContribution implements IImageRenderContribution {
|
|
6
|
-
time: BaseRenderContributionTime;
|
|
7
|
-
drawShape(graphic: IImage, context: IContext2d, x: number, y: number, doFill: boolean, doStroke: boolean, fVisible: boolean, sVisible: boolean, graphicAttribute: Required<IGraphicAttribute>, drawContext: IDrawContext, fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean): void;
|
|
8
|
-
}
|
|
9
5
|
export declare class DefaultImageRenderContribution extends DefaultRectRenderContribution implements IImageRenderContribution {
|
|
10
6
|
time: BaseRenderContributionTime;
|
|
11
7
|
useStyle: boolean;
|
|
@@ -13,4 +9,4 @@ export declare class DefaultImageRenderContribution extends DefaultRectRenderCon
|
|
|
13
9
|
drawShape(rect: any, context: IContext2d, x: number, y: number, doFill: boolean, doStroke: boolean, fVisible: boolean, sVisible: boolean, rectAttribute: any, drawContext: IDrawContext, fillCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean): void;
|
|
14
10
|
}
|
|
15
11
|
export declare const defaultImageRenderContribution: DefaultImageRenderContribution;
|
|
16
|
-
export declare const defaultImageBackgroundRenderContribution:
|
|
12
|
+
export declare const defaultImageBackgroundRenderContribution: DefaultBaseBackgroundRenderContribution;
|
|
@@ -1,59 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { DefaultBaseBackgroundRenderContribution } from "./base-contribution-render";
|
|
1
|
+
import { defaultBaseBackgroundRenderContribution } from "./base-contribution-render";
|
|
4
2
|
|
|
5
3
|
import { BaseRenderContributionTime } from "../../../../common/enums";
|
|
6
4
|
|
|
7
|
-
import { isNumber, isObject } from "@visactor/vutils";
|
|
8
|
-
|
|
9
|
-
import { parsePadding } from "../../../../common/utils";
|
|
10
|
-
|
|
11
|
-
import { createRectPath } from "../../../../common/shape/rect";
|
|
12
|
-
|
|
13
5
|
import { DefaultRectRenderContribution } from "./rect-contribution-render";
|
|
14
6
|
|
|
15
|
-
export class DefaultImageBackgroundRenderContribution extends DefaultBaseBackgroundRenderContribution {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments), this.time = BaseRenderContributionTime.beforeFillStroke;
|
|
18
|
-
}
|
|
19
|
-
drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
|
|
20
|
-
const {background: background, backgroundMode: backgroundMode = graphicAttribute.backgroundMode, backgroundFit: backgroundFit = graphicAttribute.backgroundFit, width: width, height: height} = graphic.attribute;
|
|
21
|
-
if (background) if (graphic.backgroundImg) {
|
|
22
|
-
const res = graphic.resources.get(background);
|
|
23
|
-
if ("success" !== res.state || !res.data) return;
|
|
24
|
-
if (context.save(), graphic.parent && !graphic.transMatrix.onlyTranslate()) {
|
|
25
|
-
const groupAttribute = getTheme(graphic.parent).group, {scrollX: scrollX = groupAttribute.scrollX, scrollY: scrollY = groupAttribute.scrollY} = graphic.parent.attribute;
|
|
26
|
-
context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), context.translate(scrollX, scrollY);
|
|
27
|
-
}
|
|
28
|
-
const b = graphic.AABBBounds;
|
|
29
|
-
this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.restore(),
|
|
30
|
-
graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
|
|
31
|
-
} else if (isObject(background)) {
|
|
32
|
-
const {stroke: stroke, fill: fill, lineWidth: lineWidth = 1, cornerRadius: cornerRadius = 0, expandX: expandX = 0, expandY: expandY = 0} = background;
|
|
33
|
-
if (!stroke && !fill) return;
|
|
34
|
-
context.beginPath();
|
|
35
|
-
const {x: x, y: y, width: width, height: height} = getActualPosition(graphic);
|
|
36
|
-
cornerRadius ? createRectPath(context, x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY, cornerRadius) : context.rect(x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY),
|
|
37
|
-
context.globalAlpha = 1, fill && (context.fillStyle = fill, context.fill()), stroke && lineWidth > 0 && (context.lineWidth = lineWidth,
|
|
38
|
-
context.strokeStyle = stroke, context.stroke());
|
|
39
|
-
} else context.beginPath(), context.rect(x, y, width || 0, height || 0), context.fillStyle = background,
|
|
40
|
-
context.globalAlpha = 1, context.fill();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function getActualPosition(graphic) {
|
|
45
|
-
const boundsPadding = parsePadding(graphic.attribute.boundsPadding), bounds = graphic.AABBBounds;
|
|
46
|
-
let x = bounds.x1, y = bounds.y1, width = bounds.width(), height = bounds.height();
|
|
47
|
-
return isNumber(boundsPadding) ? (x += boundsPadding, y += boundsPadding, width -= 2 * boundsPadding,
|
|
48
|
-
height -= 2 * boundsPadding) : (x += boundsPadding[3], y += boundsPadding[0], width -= boundsPadding[1] + boundsPadding[3],
|
|
49
|
-
height -= boundsPadding[0] + boundsPadding[2]), {
|
|
50
|
-
x: x,
|
|
51
|
-
y: y,
|
|
52
|
-
width: width,
|
|
53
|
-
height: height
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
7
|
export class DefaultImageRenderContribution extends DefaultRectRenderContribution {
|
|
58
8
|
constructor() {
|
|
59
9
|
super(...arguments), this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0,
|
|
@@ -66,5 +16,5 @@ export class DefaultImageRenderContribution extends DefaultRectRenderContributio
|
|
|
66
16
|
|
|
67
17
|
export const defaultImageRenderContribution = new DefaultImageRenderContribution;
|
|
68
18
|
|
|
69
|
-
export const defaultImageBackgroundRenderContribution =
|
|
19
|
+
export const defaultImageBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
|
|
70
20
|
//# sourceMappingURL=image-contribution-render.js.map
|