Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Auto release] release 0.18.4 #1063

Merged
merged 12 commits into from
Mar 12, 2024
Merged
26 changes: 13 additions & 13 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/config/rush/version-policies.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"0.18.3","nextBump":"patch"}]
[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"0.18.4","nextBump":"patch"}]
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@visactor/vchart": "1.3.0",
"@visactor/vutils": "~0.18.1",
"@visactor/vgrammar": "~0.5.7",
"@visactor/vrender": "workspace:0.18.3",
"@visactor/vrender": "workspace:0.18.4",
"markdown-it": "^13.0.0",
"highlight.js": "^11.8.0",
"axios": "^1.4.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/react-vrender-utils/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/react-vrender-utils",
"entries": [
{
"version": "0.18.4",
"tag": "@visactor/react-vrender-utils_v0.18.4",
"date": "Tue, 12 Mar 2024 09:40:06 GMT",
"comments": {}
},
{
"version": "0.18.3",
"tag": "@visactor/react-vrender-utils_v0.18.3",
Expand Down
7 changes: 6 additions & 1 deletion packages/react-vrender-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/react-vrender-utils

This log was last generated on Mon, 11 Mar 2024 08:24:00 GMT and should not be manually modified.
This log was last generated on Tue, 12 Mar 2024 09:40:06 GMT and should not be manually modified.

## 0.18.4
Tue, 12 Mar 2024 09:40:06 GMT

_Version update only_

## 0.18.3
Mon, 11 Mar 2024 08:24:00 GMT
Expand Down
6 changes: 3 additions & 3 deletions packages/react-vrender-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/react-vrender-utils",
"version": "0.18.3",
"version": "0.18.4",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -24,8 +24,8 @@
"react-dom": "^18.2.0"
},
"dependencies": {
"@visactor/vrender": "workspace:0.18.3",
"@visactor/react-vrender": "workspace:0.18.3",
"@visactor/vrender": "workspace:0.18.4",
"@visactor/react-vrender": "workspace:0.18.4",
"@visactor/vutils": "~0.18.1",
"react-reconciler": "^0.29.0",
"tslib": "^2.3.1"
Expand Down
6 changes: 6 additions & 0 deletions packages/react-vrender/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/react-vrender",
"entries": [
{
"version": "0.18.4",
"tag": "@visactor/react-vrender_v0.18.4",
"date": "Tue, 12 Mar 2024 09:40:06 GMT",
"comments": {}
},
{
"version": "0.18.3",
"tag": "@visactor/react-vrender_v0.18.3",
Expand Down
7 changes: 6 additions & 1 deletion packages/react-vrender/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/react-vrender

This log was last generated on Mon, 11 Mar 2024 08:24:00 GMT and should not be manually modified.
This log was last generated on Tue, 12 Mar 2024 09:40:06 GMT and should not be manually modified.

## 0.18.4
Tue, 12 Mar 2024 09:40:06 GMT

_Version update only_

## 0.18.3
Mon, 11 Mar 2024 08:24:00 GMT
Expand Down
4 changes: 2 additions & 2 deletions packages/react-vrender/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/react-vrender",
"version": "0.18.3",
"version": "0.18.4",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -23,7 +23,7 @@
"react": "^18.2.0"
},
"dependencies": {
"@visactor/vrender": "workspace:0.18.3",
"@visactor/vrender": "workspace:0.18.4",
"@visactor/vutils": "~0.18.1",
"react-reconciler": "^0.29.0",
"tslib": "^2.3.1"
Expand Down
6 changes: 6 additions & 0 deletions packages/vrender-components/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/vrender-components",
"entries": [
{
"version": "0.18.4",
"tag": "@visactor/vrender-components_v0.18.4",
"date": "Tue, 12 Mar 2024 09:40:06 GMT",
"comments": {}
},
{
"version": "0.18.3",
"tag": "@visactor/vrender-components_v0.18.3",
Expand Down
7 changes: 6 additions & 1 deletion packages/vrender-components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/vrender-components

This log was last generated on Mon, 11 Mar 2024 08:24:00 GMT and should not be manually modified.
This log was last generated on Tue, 12 Mar 2024 09:40:06 GMT and should not be manually modified.

## 0.18.4
Tue, 12 Mar 2024 09:40:06 GMT

_Version update only_

## 0.18.3
Mon, 11 Mar 2024 08:24:00 GMT
Expand Down
6 changes: 3 additions & 3 deletions packages/vrender-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vrender-components",
"version": "0.18.3",
"version": "0.18.4",
"description": "components library for dp visualization",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -24,8 +24,8 @@
"analysis-core": "bundle -f umd -a -i core.ts"
},
"dependencies": {
"@visactor/vrender-core": "workspace:0.18.3",
"@visactor/vrender-kits": "workspace:0.18.3",
"@visactor/vrender-core": "workspace:0.18.4",
"@visactor/vrender-kits": "workspace:0.18.4",
"@visactor/vutils": "~0.18.1",
"@visactor/vscale": "~0.17.3"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/vrender-core/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/vrender-core",
"entries": [
{
"version": "0.18.4",
"tag": "@visactor/vrender-core_v0.18.4",
"date": "Tue, 12 Mar 2024 09:40:06 GMT",
"comments": {}
},
{
"version": "0.18.3",
"tag": "@visactor/vrender-core_v0.18.3",
Expand Down
7 changes: 6 additions & 1 deletion packages/vrender-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/vrender-core

This log was last generated on Mon, 11 Mar 2024 08:24:00 GMT and should not be manually modified.
This log was last generated on Tue, 12 Mar 2024 09:40:06 GMT and should not be manually modified.

## 0.18.4
Tue, 12 Mar 2024 09:40:06 GMT

_Version update only_

## 0.18.3
Mon, 11 Mar 2024 08:24:00 GMT
Expand Down
2 changes: 1 addition & 1 deletion packages/vrender-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vrender-core",
"version": "0.18.3",
"version": "0.18.4",
"description": "",
"sideEffects": [
"./src/modules.ts",
Expand Down
49 changes: 28 additions & 21 deletions packages/vrender-core/src/canvas/empty-context.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { IMatrix } from '@visactor/vutils';
import { Matrix } from '@visactor/vutils';
import { injectable } from '../common/inversify-lite';
import type {
Expand Down Expand Up @@ -46,31 +47,32 @@ const globalPoint = { x: 0, y: 0 };

@injectable()
export class EmptyContext2d implements IContext2d {
path: CustomPath2D;
canvas: null;
stack: Matrix[];
protected matrix: Matrix;
protected applyedMatrix?: Matrix; // 被应用的matrix
declare path: CustomPath2D;
declare canvas: null;
declare stack: Matrix[];
protected declare matrix: Matrix;
protected declare applyedMatrix?: Matrix; // 被应用的matrix
// 属性代理
fillStyle: string | CanvasGradient | CanvasPattern;
declare fillStyle: string | CanvasGradient | CanvasPattern;
/**
* @deprecated font方法不建议使用,请使用setTextStyle
*/
font: string;
globalAlpha: number;
lineCap: string;
lineDashOffset: number;
lineJoin: string;
lineWidth: number;
miterLimit: number;
shadowBlur: number;
shadowColor: string;
shadowOffsetX: number;
shadowOffsetY: number;
strokeStyle: string | CanvasGradient | CanvasPattern;
textAlign: string;
textBaseline: string;
dpr: number;
declare font: string;
declare globalAlpha: number;
declare lineCap: string;
declare lineDashOffset: number;
declare lineJoin: string;
declare lineWidth: number;
declare miterLimit: number;
declare shadowBlur: number;
declare shadowColor: string;
declare shadowOffsetX: number;
declare shadowOffsetY: number;
declare strokeStyle: string | CanvasGradient | CanvasPattern;
declare textAlign: string;
declare textBaseline: string;
declare dpr: number;
declare _clearMatrix: IMatrix;

get nativeContext(): any {
return this.path;
Expand All @@ -82,6 +84,7 @@ export class EmptyContext2d implements IContext2d {
this.dpr = dpr;
this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0);
this.path = new CustomPath2D();
this._clearMatrix = new Matrix(1, 0, 0, 1, 0, 0);
}

getCanvas(): ICanvas {
Expand Down Expand Up @@ -542,6 +545,10 @@ export class EmptyContext2d implements IContext2d {
this.setTransformFromMatrix(initMatrix, setTransform, dpr);
}

setClearMatrix(a: number, b: number, c: number, d: number, e: number, f: number) {
this._clearMatrix.setValue(a, b, c, d, e, f);
}

onlyTranslate(dpr: number = this.dpr): boolean {
return this.matrix.a === dpr && this.matrix.b === 0 && this.matrix.c === 0 && this.matrix.d === dpr;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ export class OffscreenLayerHandlerContribution implements ILayerHandlerContribut
render(group: IGroup[], params: ILayerHandlerDrawParams): void {
params.renderService.render(group, {
context: this.context,
viewBox: params.stage.window.getViewBox(),
transMatrix: params.stage.window.getViewBoxTransform(),
...params,
x: 0,
y: 0,
clear: params.background ?? '#ffffff'
});
}
Expand All @@ -92,7 +92,11 @@ export class OffscreenLayerHandlerContribution implements ILayerHandlerContribut
const context = target.getContext();
const targetDpr = target.dpr;

const { x = 0, y = 0, width = this.layer.viewWidth, height = this.layer.viewHeight } = params;
const { viewBox } = params;
const x = viewBox.x1;
const y = viewBox.y1;
const width = viewBox.width();
const height = viewBox.height();
// 这个context可能是外部的,不要使用内置的状态,直接用原生的context
context.nativeContext.save();
context.nativeContext.setTransform(targetDpr, 0, 0, targetDpr, 0, 0);
Expand Down
Loading
Loading