Skip to content

Commit

Permalink
Release (#1899)
Browse files Browse the repository at this point in the history
* fix: abnormal word breaking in text (#1896)

* Version Packages (#1898)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 23, 2025
1 parent 81bdf2f commit ee028e2
Show file tree
Hide file tree
Showing 97 changed files with 471 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "next",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
33 changes: 33 additions & 0 deletions __tests__/demos/bugfix/textWordWrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,37 @@ export async function textWordWrap(context: { canvas: Canvas }) {
},
});

const text4 = new Text({
style: {
x: 100,
y: 400,
wordWrap: true,
wordWrapWidth: 2210,
maxLines: 10,
textOverflow: 'ellipsis',
fontFamily:
'Roboto, PingFangSC, BlinkMacSystemFont, Microsoft YaHei, Arial, sans-serif',
fontSize: 12,
fontWeight: 700,
fill: '#000000',
opacity: 1,
textAlign: 'center',
textBaseline: 'middle',
linkTextFill: '#326EF4',
text: '{"acodeList":"[4419, 4413]","roadList":"[122702094, 121224203, 122702115, 98717265, 122702113, 98718278, 98718270, 98718271, 124670851, 98719406, 122702114, 98719557, 121323912, 122702093, 98718269]","高低标准标签":"高普","isFilter":"否","质量标准":"模型类","标准编号":"","客户标签":"","高速误报率":"","普通路误报率":"","cityName":"东莞市","adcode":"441302","hfc":"3","errorOriginLabel":"虚拟"}',
},
});
console.log(text4);
const rect4 = new Rect({
style: {
x: text4.style.x,
y: text4.style.y,
width: text4.style.wordWrapWidth,
height: +text4.style.fontSize * text4.style.maxLines,
stroke: '#000000',
},
});

canvas.appendChild(text0);
canvas.appendChild(rect0);
canvas.appendChild(text1);
Expand All @@ -140,6 +171,8 @@ export async function textWordWrap(context: { canvas: Canvas }) {
canvas.appendChild(rect2);
canvas.appendChild(text3);
canvas.appendChild(rect3);
canvas.appendChild(text4);
canvas.appendChild(rect4);

// benchmark
// ----------
Expand Down
7 changes: 7 additions & 0 deletions packages/g-camera-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-camera-api

## 2.0.35

### Patch Changes

- Updated dependencies [284b6cb]
- @antv/g-lite@2.2.16

## 2.0.34

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-camera-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-camera-api",
"version": "2.0.34",
"version": "2.0.35",
"description": "A simple implementation of Camera API.",
"keywords": [
"antv",
Expand Down
13 changes: 13 additions & 0 deletions packages/g-canvas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @antv/g-canvas

## 2.0.39

### Patch Changes

- Updated dependencies [284b6cb]
- @antv/g-lite@2.2.16
- @antv/g-plugin-canvas-path-generator@2.1.16
- @antv/g-plugin-canvas-picker@2.1.18
- @antv/g-plugin-canvas-renderer@2.2.18
- @antv/g-plugin-dom-interaction@2.1.21
- @antv/g-plugin-html-renderer@2.1.21
- @antv/g-plugin-image-loader@2.1.18

## 2.0.38

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-canvas",
"version": "2.0.38",
"version": "2.0.39",
"description": "A renderer implemented by Canvas 2D API",
"keywords": [
"antv",
Expand Down
13 changes: 13 additions & 0 deletions packages/g-canvaskit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @antv/g-canvaskit

## 1.0.38

### Patch Changes

- Updated dependencies [284b6cb]
- @antv/g-lite@2.2.16
- @antv/g-plugin-canvas-path-generator@2.1.16
- @antv/g-plugin-canvas-picker@2.1.18
- @antv/g-plugin-canvaskit-renderer@2.1.18
- @antv/g-plugin-dom-interaction@2.1.21
- @antv/g-plugin-html-renderer@2.1.21
- @antv/g-plugin-image-loader@2.1.18

## 1.0.37

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-canvaskit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-canvaskit",
"version": "1.0.37",
"version": "1.0.38",
"description": "A renderer implemented by CanvasKit",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-components

## 2.0.32

### Patch Changes

- Updated dependencies [284b6cb]
- @antv/g-lite@2.2.16

## 2.0.31

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-components",
"version": "2.0.31",
"version": "2.0.32",
"description": "Components for g",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-dom-mutation-observer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-dom-mutation-observer-api

## 2.0.32

### Patch Changes

- Updated dependencies [284b6cb]
- @antv/g-lite@2.2.16

## 2.0.31

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-dom-mutation-observer-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-dom-mutation-observer-api",
"version": "2.0.31",
"version": "2.0.32",
"description": "A simple implementation of DOM MutationObserver API.",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-gesture/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-gesture

## 3.0.32

### Patch Changes

- Updated dependencies [284b6cb]
- @antv/g-lite@2.2.16

## 3.0.31

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-gesture/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-gesture",
"version": "3.0.31",
"version": "3.0.32",
"description": "G Gesture",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-image-exporter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-image-exporter

## 1.0.32

### Patch Changes

- Updated dependencies [284b6cb]
- @antv/g-lite@2.2.16

## 1.0.31

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-image-exporter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-image-exporter",
"version": "1.0.31",
"version": "1.0.32",
"description": "A image exporter for G using DOM API",
"keywords": [
"antv",
Expand Down
6 changes: 6 additions & 0 deletions packages/g-lite/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @antv/g-lite

## 2.2.16

### Patch Changes

- 284b6cb: fix: abnormal word breaking in text

## 2.2.15

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/g-lite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-lite",
"version": "2.2.15",
"version": "2.2.16",
"description": "A core module for rendering engine implements DOM API.",
"keywords": [
"antv",
Expand Down Expand Up @@ -62,4 +62,4 @@
"publishConfig": {
"access": "public"
}
}
}
7 changes: 3 additions & 4 deletions packages/g-lite/src/services/TextService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ export class TextService {
lines = this.trimToBreakable(lines);
currentLineWidth = this.sumTextWidthByCache(
lines[currentLineIndex] || '',
cache,
calcWidth,
);
}

Expand Down Expand Up @@ -588,11 +588,10 @@ export class TextService {

private sumTextWidthByCache(
text: string,
cache: { [key in string]: number },
calcWidthWithCache: (txt: string) => number,
) {
return text.split('').reduce((sum: number, c) => {
if (!cache[c]) throw Error('cannot count the word without cache');
return sum + cache[c];
return sum + calcWidthWithCache(c);
}, 0);
}

Expand Down
7 changes: 7 additions & 0 deletions packages/g-lottie-player/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-lottie-player

## 1.0.32

### Patch Changes

- Updated dependencies [284b6cb]
- @antv/g-lite@2.2.16

## 1.0.31

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-lottie-player/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-lottie-player",
"version": "1.0.31",
"version": "1.0.32",
"description": "A lottie player for G",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-mobile-canvas-element/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-mobile-canvas-element

## 1.0.32

### Patch Changes

- Updated dependencies [284b6cb]
- @antv/g-lite@2.2.16

## 1.0.31

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-mobile-canvas-element/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-mobile-canvas-element",
"version": "1.0.31",
"version": "1.0.32",
"description": "Create a CanvasLike element from existed context in mobile environment",
"keywords": [
"antv",
Expand Down
14 changes: 14 additions & 0 deletions packages/g-mobile-canvas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @antv/g-mobile-canvas

## 1.0.36

### Patch Changes

- Updated dependencies [284b6cb]
- @antv/g-lite@2.2.16
- @antv/g-plugin-canvas-path-generator@2.1.16
- @antv/g-plugin-canvas-picker@2.1.18
- @antv/g-plugin-canvas-renderer@2.2.18
- @antv/g-plugin-dragndrop@2.0.32
- @antv/g-plugin-gesture@2.0.32
- @antv/g-plugin-image-loader@2.1.18
- @antv/g-plugin-mobile-interaction@1.0.32

## 1.0.35

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-mobile-canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-mobile-canvas",
"version": "1.0.35",
"version": "1.0.36",
"description": "A renderer implemented with Canvas2D API in mobile environment",
"keywords": [
"antv",
Expand Down
12 changes: 12 additions & 0 deletions packages/g-mobile-svg/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @antv/g-mobile-svg

## 1.0.34

### Patch Changes

- Updated dependencies [284b6cb]
- @antv/g-lite@2.2.16
- @antv/g-plugin-dragndrop@2.0.32
- @antv/g-plugin-gesture@2.0.32
- @antv/g-plugin-mobile-interaction@1.0.32
- @antv/g-plugin-svg-picker@2.0.34
- @antv/g-plugin-svg-renderer@2.2.16

## 1.0.33

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-mobile-svg/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-mobile-svg",
"version": "1.0.33",
"version": "1.0.34",
"description": "A renderer implemented by SVG in mobile environment",
"keywords": [
"antv",
Expand Down
13 changes: 13 additions & 0 deletions packages/g-mobile-webgl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @antv/g-mobile-webgl

## 1.0.43

### Patch Changes

- Updated dependencies [284b6cb]
- @antv/g-lite@2.2.16
- @antv/g-plugin-device-renderer@2.2.18
- @antv/g-plugin-dragndrop@2.0.32
- @antv/g-plugin-gesture@2.0.32
- @antv/g-plugin-html-renderer@2.1.21
- @antv/g-plugin-image-loader@2.1.18
- @antv/g-plugin-mobile-interaction@1.0.32

## 1.0.42

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-mobile-webgl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-mobile-webgl",
"version": "1.0.42",
"version": "1.0.43",
"description": "A renderer implemented by WebGL1/2 in mobile environment",
"keywords": [
"antv",
Expand Down
Loading

0 comments on commit ee028e2

Please sign in to comment.