@visactor/vrender 0.20.14 → 0.20.15
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/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +40 -27
- package/dist/index.js +40 -27
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +3 -3
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,7 +21,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
21
21
|
|
|
22
22
|
const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits");
|
|
23
23
|
|
|
24
|
-
exports.version = "0.20.
|
|
24
|
+
exports.version = "0.20.15", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
|
|
25
25
|
vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0, vrender_core_1.isNodeEnv)() && (0,
|
|
26
26
|
vrender_kits_1.loadNodeEnv)(vrender_core_1.container), (0, vrender_kits_2.registerArc)(),
|
|
27
27
|
(0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(), (0, vrender_kits_2.registerCircle)(),
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AACtB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.20.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AACtB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.20.15\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
|
package/dist/index.es.js
CHANGED
|
@@ -3990,7 +3990,8 @@ const DefaultAttribute = Object.assign(Object.assign(Object.assign({
|
|
|
3990
3990
|
globalZIndex: 1,
|
|
3991
3991
|
globalCompositeOperation: "",
|
|
3992
3992
|
overflow: "hidden",
|
|
3993
|
-
shadowPickMode: "graphic"
|
|
3993
|
+
shadowPickMode: "graphic",
|
|
3994
|
+
keepStrokeScale: !1
|
|
3994
3995
|
}, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
|
|
3995
3996
|
function addAttributeToPrototype(obj, c, keys) {
|
|
3996
3997
|
keys.forEach(key => {
|
|
@@ -12029,7 +12030,8 @@ class DefaultArcRenderContribution {
|
|
|
12029
12030
|
x: originX = arcAttribute.x,
|
|
12030
12031
|
y: originY = arcAttribute.y,
|
|
12031
12032
|
scaleX = arcAttribute.scaleX,
|
|
12032
|
-
scaleY = arcAttribute.scaleY
|
|
12033
|
+
scaleY = arcAttribute.scaleY,
|
|
12034
|
+
keepStrokeScale = arcAttribute.keepStrokeScale
|
|
12033
12035
|
} = arc.attribute;
|
|
12034
12036
|
let {
|
|
12035
12037
|
innerRadius = arcAttribute.innerRadius,
|
|
@@ -12041,7 +12043,7 @@ class DefaultArcRenderContribution {
|
|
|
12041
12043
|
{
|
|
12042
12044
|
distance = arcAttribute[key].distance
|
|
12043
12045
|
} = borderStyle,
|
|
12044
|
-
d = getScaledStroke(context, distance, context.dpr),
|
|
12046
|
+
d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
|
|
12045
12047
|
deltaAngle = distance / outerRadius,
|
|
12046
12048
|
sign = "outerBorder" === key ? 1 : -1;
|
|
12047
12049
|
if (arc.setAttributes({
|
|
@@ -12086,14 +12088,15 @@ class DefaultCircleRenderContribution {
|
|
|
12086
12088
|
x: originX = circleAttribute.x,
|
|
12087
12089
|
y: originY = circleAttribute.y,
|
|
12088
12090
|
scaleX = circleAttribute.scaleX,
|
|
12089
|
-
scaleY = circleAttribute.scaleY
|
|
12091
|
+
scaleY = circleAttribute.scaleY,
|
|
12092
|
+
keepStrokeScale = circleAttribute.keepStrokeScale
|
|
12090
12093
|
} = circle.attribute,
|
|
12091
12094
|
renderBorder = (borderStyle, key) => {
|
|
12092
12095
|
const doStroke = !(!borderStyle || !borderStyle.stroke),
|
|
12093
12096
|
{
|
|
12094
12097
|
distance = circleAttribute[key].distance
|
|
12095
12098
|
} = borderStyle,
|
|
12096
|
-
d = getScaledStroke(context, distance, context.dpr),
|
|
12099
|
+
d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
|
|
12097
12100
|
sign = "outerBorder" === key ? 1 : -1;
|
|
12098
12101
|
if (context.beginPath(), context.arc(x, y, radius + sign * d, startAngle, endAngle), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute), strokeCb) strokeCb(context, borderStyle, circleAttribute[key]);else if (doStroke) {
|
|
12099
12102
|
const lastOpacity = circleAttribute[key].opacity;
|
|
@@ -12212,7 +12215,8 @@ class DefaultRectRenderContribution {
|
|
|
12212
12215
|
scaleX = rectAttribute.scaleX,
|
|
12213
12216
|
scaleY = rectAttribute.scaleY,
|
|
12214
12217
|
x1: x1,
|
|
12215
|
-
y1: y1
|
|
12218
|
+
y1: y1,
|
|
12219
|
+
keepStrokeScale = rectAttribute.keepStrokeScale
|
|
12216
12220
|
} = rect.attribute;
|
|
12217
12221
|
let {
|
|
12218
12222
|
width: width,
|
|
@@ -12225,7 +12229,7 @@ class DefaultRectRenderContribution {
|
|
|
12225
12229
|
{
|
|
12226
12230
|
distance = rectAttribute[key].distance
|
|
12227
12231
|
} = borderStyle,
|
|
12228
|
-
d = getScaledStroke(context, distance, context.dpr),
|
|
12232
|
+
d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
|
|
12229
12233
|
nextX = x + sign * d,
|
|
12230
12234
|
nextY = y + sign * d,
|
|
12231
12235
|
dw = 2 * d;
|
|
@@ -12382,14 +12386,15 @@ class DefaultSymbolRenderContribution {
|
|
|
12382
12386
|
x: originX = symbolAttribute.x,
|
|
12383
12387
|
y: originY = symbolAttribute.y,
|
|
12384
12388
|
scaleX = symbolAttribute.scaleX,
|
|
12385
|
-
scaleY = symbolAttribute.scaleY
|
|
12389
|
+
scaleY = symbolAttribute.scaleY,
|
|
12390
|
+
keepStrokeScale = symbolAttribute.keepStrokeScale
|
|
12386
12391
|
} = symbol.attribute,
|
|
12387
12392
|
renderBorder = (borderStyle, key) => {
|
|
12388
12393
|
const doStroke = !(!borderStyle || !borderStyle.stroke),
|
|
12389
12394
|
{
|
|
12390
12395
|
distance = symbolAttribute[key].distance
|
|
12391
12396
|
} = borderStyle,
|
|
12392
|
-
d = getScaledStroke(context, distance, context.dpr),
|
|
12397
|
+
d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
|
|
12393
12398
|
sign = "outerBorder" === key ? 1 : -1;
|
|
12394
12399
|
if (context.beginPath(), !1 === parsedPath.drawOffset(context, size, x, y, sign * d) && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), strokeCb) strokeCb(context, borderStyle, symbolAttribute[key]);else if (doStroke) {
|
|
12395
12400
|
const lastOpacity = symbolAttribute[key].opacity;
|
|
@@ -23917,7 +23922,7 @@ class Gesture extends EventEmitter {
|
|
|
23917
23922
|
startTime: startTime,
|
|
23918
23923
|
startPoints: startPoints
|
|
23919
23924
|
} = this;
|
|
23920
|
-
if (eventType) return eventType;
|
|
23925
|
+
if ("press" === eventType) return eventType;
|
|
23921
23926
|
let type;
|
|
23922
23927
|
return type = clock.now() - startTime > this.config.press.time && calcDistance(startPoints[0], point) < this.config.press.threshold ? "press" : "pan", this.eventType = type, type;
|
|
23923
23928
|
}
|
|
@@ -24449,9 +24454,10 @@ let BrowserContext2d = class {
|
|
|
24449
24454
|
lineJoin = defaultParams.lineJoin,
|
|
24450
24455
|
lineDash = defaultParams.lineDash,
|
|
24451
24456
|
lineCap = defaultParams.lineCap,
|
|
24452
|
-
miterLimit = defaultParams.miterLimit
|
|
24457
|
+
miterLimit = defaultParams.miterLimit,
|
|
24458
|
+
keepStrokeScale = defaultParams.keepStrokeScale
|
|
24453
24459
|
} = attribute;
|
|
24454
|
-
_context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
24460
|
+
_context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
24455
24461
|
}
|
|
24456
24462
|
}
|
|
24457
24463
|
setTextStyleWithoutAlignBaseline(params, defaultParams, z) {
|
|
@@ -25351,8 +25357,9 @@ class PickerBase {
|
|
|
25351
25357
|
return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, (context, arcAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, arcAttribute, themeAttribute) => {
|
|
25352
25358
|
if (picked) return !0;
|
|
25353
25359
|
const lineWidth = arcAttribute.lineWidth || themeAttribute.lineWidth,
|
|
25354
|
-
pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer
|
|
25355
|
-
|
|
25360
|
+
pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
25361
|
+
keepStrokeScale = arcAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
25362
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
25356
25363
|
}), pickContext.highPerformanceRestore(), picked;
|
|
25357
25364
|
}
|
|
25358
25365
|
}
|
|
@@ -25625,8 +25632,9 @@ class RectPickerBase {
|
|
|
25625
25632
|
if (!onlyTranslate || rect.shadowRoot || isNumber$1(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
|
|
25626
25633
|
if (picked) return !0;
|
|
25627
25634
|
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
25628
|
-
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer
|
|
25629
|
-
|
|
25635
|
+
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
25636
|
+
keepStrokeScale = rectAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
25637
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
25630
25638
|
});else {
|
|
25631
25639
|
const {
|
|
25632
25640
|
fill = rectAttribute.fill,
|
|
@@ -25940,9 +25948,10 @@ let LynxContext2d = class extends BrowserContext2d {
|
|
|
25940
25948
|
lineJoin = defaultParams.lineJoin,
|
|
25941
25949
|
lineDash = defaultParams.lineDash,
|
|
25942
25950
|
lineCap = defaultParams.lineCap,
|
|
25943
|
-
miterLimit = defaultParams.miterLimit
|
|
25951
|
+
miterLimit = defaultParams.miterLimit,
|
|
25952
|
+
keepStrokeScale = defaultParams.keepStrokeScale
|
|
25944
25953
|
} = attribute;
|
|
25945
|
-
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
25954
|
+
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
25946
25955
|
}
|
|
25947
25956
|
}
|
|
25948
25957
|
measureText(text) {
|
|
@@ -26570,9 +26579,10 @@ let TaroContext2d = class extends BrowserContext2d {
|
|
|
26570
26579
|
lineJoin = defaultParams.lineJoin,
|
|
26571
26580
|
lineDash = defaultParams.lineDash,
|
|
26572
26581
|
lineCap = defaultParams.lineCap,
|
|
26573
|
-
miterLimit = defaultParams.miterLimit
|
|
26582
|
+
miterLimit = defaultParams.miterLimit,
|
|
26583
|
+
keepStrokeScale = defaultParams.keepStrokeScale
|
|
26574
26584
|
} = attribute;
|
|
26575
|
-
_context.setGlobalAlpha(strokeOpacity * opacity), _context.setLineWidth(getScaledStroke(this, lineWidth, this.dpr)), _context.setStrokeStyle(createColor(this, stroke, params, offsetX, offsetY)), _context.setLineJoin(lineJoin), lineDash && _context.setLineDash(lineDash), _context.setLineCap(lineCap), _context.setMiterLimit(miterLimit);
|
|
26585
|
+
_context.setGlobalAlpha(strokeOpacity * opacity), _context.setLineWidth(keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr)), _context.setStrokeStyle(createColor(this, stroke, params, offsetX, offsetY)), _context.setLineJoin(lineJoin), lineDash && _context.setLineDash(lineDash), _context.setLineCap(lineCap), _context.setMiterLimit(miterLimit);
|
|
26576
26586
|
}
|
|
26577
26587
|
}
|
|
26578
26588
|
setTextStyleWithoutAlignBaseline(params, defaultParams) {
|
|
@@ -27612,9 +27622,10 @@ let HarmonyContext2d = class extends BrowserContext2d {
|
|
|
27612
27622
|
lineJoin = defaultParams.lineJoin,
|
|
27613
27623
|
lineDash = defaultParams.lineDash,
|
|
27614
27624
|
lineCap = defaultParams.lineCap,
|
|
27615
|
-
miterLimit = defaultParams.miterLimit
|
|
27625
|
+
miterLimit = defaultParams.miterLimit,
|
|
27626
|
+
keepStrokeScale = defaultParams.keepStrokeScale
|
|
27616
27627
|
} = attribute;
|
|
27617
|
-
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
27628
|
+
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
27618
27629
|
}
|
|
27619
27630
|
}
|
|
27620
27631
|
measureText(text) {
|
|
@@ -28021,8 +28032,9 @@ class BaseLinePicker extends BaseRender {
|
|
|
28021
28032
|
return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, context => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, lineAttribute, themeAttribute) => {
|
|
28022
28033
|
if (picked) return !0;
|
|
28023
28034
|
const lineWidth = lineAttribute.lineWidth || themeAttribute.lineWidth,
|
|
28024
|
-
pickStrokeBuffer = lineAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer
|
|
28025
|
-
|
|
28035
|
+
pickStrokeBuffer = lineAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
28036
|
+
keepStrokeScale = lineAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
28037
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
|
|
28026
28038
|
}), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
28027
28039
|
}
|
|
28028
28040
|
}
|
|
@@ -28157,8 +28169,9 @@ let DefaultCanvasSymbolPicker = class extends Base3dPicker {
|
|
|
28157
28169
|
return this.canvasRenderer.drawShape(symbol, pickContext, x, y, {}, null, (context, symbolAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, symbolAttribute, themeAttribute) => {
|
|
28158
28170
|
if (picked) return !0;
|
|
28159
28171
|
const lineWidth = symbolAttribute.lineWidth || themeAttribute.lineWidth,
|
|
28160
|
-
pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer
|
|
28161
|
-
|
|
28172
|
+
pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
28173
|
+
keepStrokeScale = symbolAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
28174
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
|
|
28162
28175
|
}), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
28163
28176
|
}
|
|
28164
28177
|
};
|
|
@@ -28595,7 +28608,7 @@ const registerWrapText = _registerWrapText;
|
|
|
28595
28608
|
|
|
28596
28609
|
const roughModule = _roughModule;
|
|
28597
28610
|
|
|
28598
|
-
const version = "0.20.
|
|
28611
|
+
const version = "0.20.15";
|
|
28599
28612
|
preLoadAllModule();
|
|
28600
28613
|
if (isBrowserEnv()) {
|
|
28601
28614
|
loadBrowserEnv(container);
|
package/dist/index.js
CHANGED
|
@@ -3996,7 +3996,8 @@
|
|
|
3996
3996
|
globalZIndex: 1,
|
|
3997
3997
|
globalCompositeOperation: "",
|
|
3998
3998
|
overflow: "hidden",
|
|
3999
|
-
shadowPickMode: "graphic"
|
|
3999
|
+
shadowPickMode: "graphic",
|
|
4000
|
+
keepStrokeScale: !1
|
|
4000
4001
|
}, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
|
|
4001
4002
|
function addAttributeToPrototype(obj, c, keys) {
|
|
4002
4003
|
keys.forEach(key => {
|
|
@@ -12035,7 +12036,8 @@
|
|
|
12035
12036
|
x: originX = arcAttribute.x,
|
|
12036
12037
|
y: originY = arcAttribute.y,
|
|
12037
12038
|
scaleX = arcAttribute.scaleX,
|
|
12038
|
-
scaleY = arcAttribute.scaleY
|
|
12039
|
+
scaleY = arcAttribute.scaleY,
|
|
12040
|
+
keepStrokeScale = arcAttribute.keepStrokeScale
|
|
12039
12041
|
} = arc.attribute;
|
|
12040
12042
|
let {
|
|
12041
12043
|
innerRadius = arcAttribute.innerRadius,
|
|
@@ -12047,7 +12049,7 @@
|
|
|
12047
12049
|
{
|
|
12048
12050
|
distance = arcAttribute[key].distance
|
|
12049
12051
|
} = borderStyle,
|
|
12050
|
-
d = getScaledStroke(context, distance, context.dpr),
|
|
12052
|
+
d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
|
|
12051
12053
|
deltaAngle = distance / outerRadius,
|
|
12052
12054
|
sign = "outerBorder" === key ? 1 : -1;
|
|
12053
12055
|
if (arc.setAttributes({
|
|
@@ -12092,14 +12094,15 @@
|
|
|
12092
12094
|
x: originX = circleAttribute.x,
|
|
12093
12095
|
y: originY = circleAttribute.y,
|
|
12094
12096
|
scaleX = circleAttribute.scaleX,
|
|
12095
|
-
scaleY = circleAttribute.scaleY
|
|
12097
|
+
scaleY = circleAttribute.scaleY,
|
|
12098
|
+
keepStrokeScale = circleAttribute.keepStrokeScale
|
|
12096
12099
|
} = circle.attribute,
|
|
12097
12100
|
renderBorder = (borderStyle, key) => {
|
|
12098
12101
|
const doStroke = !(!borderStyle || !borderStyle.stroke),
|
|
12099
12102
|
{
|
|
12100
12103
|
distance = circleAttribute[key].distance
|
|
12101
12104
|
} = borderStyle,
|
|
12102
|
-
d = getScaledStroke(context, distance, context.dpr),
|
|
12105
|
+
d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
|
|
12103
12106
|
sign = "outerBorder" === key ? 1 : -1;
|
|
12104
12107
|
if (context.beginPath(), context.arc(x, y, radius + sign * d, startAngle, endAngle), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute), strokeCb) strokeCb(context, borderStyle, circleAttribute[key]);else if (doStroke) {
|
|
12105
12108
|
const lastOpacity = circleAttribute[key].opacity;
|
|
@@ -12218,7 +12221,8 @@
|
|
|
12218
12221
|
scaleX = rectAttribute.scaleX,
|
|
12219
12222
|
scaleY = rectAttribute.scaleY,
|
|
12220
12223
|
x1: x1,
|
|
12221
|
-
y1: y1
|
|
12224
|
+
y1: y1,
|
|
12225
|
+
keepStrokeScale = rectAttribute.keepStrokeScale
|
|
12222
12226
|
} = rect.attribute;
|
|
12223
12227
|
let {
|
|
12224
12228
|
width: width,
|
|
@@ -12231,7 +12235,7 @@
|
|
|
12231
12235
|
{
|
|
12232
12236
|
distance = rectAttribute[key].distance
|
|
12233
12237
|
} = borderStyle,
|
|
12234
|
-
d = getScaledStroke(context, distance, context.dpr),
|
|
12238
|
+
d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
|
|
12235
12239
|
nextX = x + sign * d,
|
|
12236
12240
|
nextY = y + sign * d,
|
|
12237
12241
|
dw = 2 * d;
|
|
@@ -12388,14 +12392,15 @@
|
|
|
12388
12392
|
x: originX = symbolAttribute.x,
|
|
12389
12393
|
y: originY = symbolAttribute.y,
|
|
12390
12394
|
scaleX = symbolAttribute.scaleX,
|
|
12391
|
-
scaleY = symbolAttribute.scaleY
|
|
12395
|
+
scaleY = symbolAttribute.scaleY,
|
|
12396
|
+
keepStrokeScale = symbolAttribute.keepStrokeScale
|
|
12392
12397
|
} = symbol.attribute,
|
|
12393
12398
|
renderBorder = (borderStyle, key) => {
|
|
12394
12399
|
const doStroke = !(!borderStyle || !borderStyle.stroke),
|
|
12395
12400
|
{
|
|
12396
12401
|
distance = symbolAttribute[key].distance
|
|
12397
12402
|
} = borderStyle,
|
|
12398
|
-
d = getScaledStroke(context, distance, context.dpr),
|
|
12403
|
+
d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
|
|
12399
12404
|
sign = "outerBorder" === key ? 1 : -1;
|
|
12400
12405
|
if (context.beginPath(), !1 === parsedPath.drawOffset(context, size, x, y, sign * d) && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), strokeCb) strokeCb(context, borderStyle, symbolAttribute[key]);else if (doStroke) {
|
|
12401
12406
|
const lastOpacity = symbolAttribute[key].opacity;
|
|
@@ -23923,7 +23928,7 @@
|
|
|
23923
23928
|
startTime: startTime,
|
|
23924
23929
|
startPoints: startPoints
|
|
23925
23930
|
} = this;
|
|
23926
|
-
if (eventType) return eventType;
|
|
23931
|
+
if ("press" === eventType) return eventType;
|
|
23927
23932
|
let type;
|
|
23928
23933
|
return type = clock.now() - startTime > this.config.press.time && calcDistance(startPoints[0], point) < this.config.press.threshold ? "press" : "pan", this.eventType = type, type;
|
|
23929
23934
|
}
|
|
@@ -24455,9 +24460,10 @@
|
|
|
24455
24460
|
lineJoin = defaultParams.lineJoin,
|
|
24456
24461
|
lineDash = defaultParams.lineDash,
|
|
24457
24462
|
lineCap = defaultParams.lineCap,
|
|
24458
|
-
miterLimit = defaultParams.miterLimit
|
|
24463
|
+
miterLimit = defaultParams.miterLimit,
|
|
24464
|
+
keepStrokeScale = defaultParams.keepStrokeScale
|
|
24459
24465
|
} = attribute;
|
|
24460
|
-
_context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
24466
|
+
_context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
24461
24467
|
}
|
|
24462
24468
|
}
|
|
24463
24469
|
setTextStyleWithoutAlignBaseline(params, defaultParams, z) {
|
|
@@ -25357,8 +25363,9 @@
|
|
|
25357
25363
|
return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, (context, arcAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, arcAttribute, themeAttribute) => {
|
|
25358
25364
|
if (picked) return !0;
|
|
25359
25365
|
const lineWidth = arcAttribute.lineWidth || themeAttribute.lineWidth,
|
|
25360
|
-
pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer
|
|
25361
|
-
|
|
25366
|
+
pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
25367
|
+
keepStrokeScale = arcAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
25368
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
25362
25369
|
}), pickContext.highPerformanceRestore(), picked;
|
|
25363
25370
|
}
|
|
25364
25371
|
}
|
|
@@ -25631,8 +25638,9 @@
|
|
|
25631
25638
|
if (!onlyTranslate || rect.shadowRoot || isNumber$1(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
|
|
25632
25639
|
if (picked) return !0;
|
|
25633
25640
|
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
25634
|
-
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer
|
|
25635
|
-
|
|
25641
|
+
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
25642
|
+
keepStrokeScale = rectAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
25643
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
25636
25644
|
});else {
|
|
25637
25645
|
const {
|
|
25638
25646
|
fill = rectAttribute.fill,
|
|
@@ -25946,9 +25954,10 @@
|
|
|
25946
25954
|
lineJoin = defaultParams.lineJoin,
|
|
25947
25955
|
lineDash = defaultParams.lineDash,
|
|
25948
25956
|
lineCap = defaultParams.lineCap,
|
|
25949
|
-
miterLimit = defaultParams.miterLimit
|
|
25957
|
+
miterLimit = defaultParams.miterLimit,
|
|
25958
|
+
keepStrokeScale = defaultParams.keepStrokeScale
|
|
25950
25959
|
} = attribute;
|
|
25951
|
-
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
25960
|
+
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
25952
25961
|
}
|
|
25953
25962
|
}
|
|
25954
25963
|
measureText(text) {
|
|
@@ -26576,9 +26585,10 @@
|
|
|
26576
26585
|
lineJoin = defaultParams.lineJoin,
|
|
26577
26586
|
lineDash = defaultParams.lineDash,
|
|
26578
26587
|
lineCap = defaultParams.lineCap,
|
|
26579
|
-
miterLimit = defaultParams.miterLimit
|
|
26588
|
+
miterLimit = defaultParams.miterLimit,
|
|
26589
|
+
keepStrokeScale = defaultParams.keepStrokeScale
|
|
26580
26590
|
} = attribute;
|
|
26581
|
-
_context.setGlobalAlpha(strokeOpacity * opacity), _context.setLineWidth(getScaledStroke(this, lineWidth, this.dpr)), _context.setStrokeStyle(createColor(this, stroke, params, offsetX, offsetY)), _context.setLineJoin(lineJoin), lineDash && _context.setLineDash(lineDash), _context.setLineCap(lineCap), _context.setMiterLimit(miterLimit);
|
|
26591
|
+
_context.setGlobalAlpha(strokeOpacity * opacity), _context.setLineWidth(keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr)), _context.setStrokeStyle(createColor(this, stroke, params, offsetX, offsetY)), _context.setLineJoin(lineJoin), lineDash && _context.setLineDash(lineDash), _context.setLineCap(lineCap), _context.setMiterLimit(miterLimit);
|
|
26582
26592
|
}
|
|
26583
26593
|
}
|
|
26584
26594
|
setTextStyleWithoutAlignBaseline(params, defaultParams) {
|
|
@@ -27618,9 +27628,10 @@
|
|
|
27618
27628
|
lineJoin = defaultParams.lineJoin,
|
|
27619
27629
|
lineDash = defaultParams.lineDash,
|
|
27620
27630
|
lineCap = defaultParams.lineCap,
|
|
27621
|
-
miterLimit = defaultParams.miterLimit
|
|
27631
|
+
miterLimit = defaultParams.miterLimit,
|
|
27632
|
+
keepStrokeScale = defaultParams.keepStrokeScale
|
|
27622
27633
|
} = attribute;
|
|
27623
|
-
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
27634
|
+
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
27624
27635
|
}
|
|
27625
27636
|
}
|
|
27626
27637
|
measureText(text) {
|
|
@@ -28027,8 +28038,9 @@
|
|
|
28027
28038
|
return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, context => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, lineAttribute, themeAttribute) => {
|
|
28028
28039
|
if (picked) return !0;
|
|
28029
28040
|
const lineWidth = lineAttribute.lineWidth || themeAttribute.lineWidth,
|
|
28030
|
-
pickStrokeBuffer = lineAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer
|
|
28031
|
-
|
|
28041
|
+
pickStrokeBuffer = lineAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
28042
|
+
keepStrokeScale = lineAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
28043
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
|
|
28032
28044
|
}), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
28033
28045
|
}
|
|
28034
28046
|
}
|
|
@@ -28163,8 +28175,9 @@
|
|
|
28163
28175
|
return this.canvasRenderer.drawShape(symbol, pickContext, x, y, {}, null, (context, symbolAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, symbolAttribute, themeAttribute) => {
|
|
28164
28176
|
if (picked) return !0;
|
|
28165
28177
|
const lineWidth = symbolAttribute.lineWidth || themeAttribute.lineWidth,
|
|
28166
|
-
pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer
|
|
28167
|
-
|
|
28178
|
+
pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
28179
|
+
keepStrokeScale = symbolAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
28180
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
|
|
28168
28181
|
}), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
28169
28182
|
}
|
|
28170
28183
|
};
|
|
@@ -28601,7 +28614,7 @@
|
|
|
28601
28614
|
|
|
28602
28615
|
const roughModule = _roughModule;
|
|
28603
28616
|
|
|
28604
|
-
const version = "0.20.
|
|
28617
|
+
const version = "0.20.15";
|
|
28605
28618
|
preLoadAllModule();
|
|
28606
28619
|
if (isBrowserEnv()) {
|
|
28607
28620
|
loadBrowserEnv(container);
|