Skip to content

Commit feb1516

Browse files
author
林舸
committed
fix: label transfrom remain
1 parent 6e1753a commit feb1516

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/api/runtime.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,12 @@ export class Runtime<Spec extends G2Spec = G2Spec> extends CompositionNode {
7676
this._bindAutoFit();
7777
this._rendering = true;
7878

79-
// @fixme The cancel render is not marked, which will cause additional rendered event.
80-
// @ref src/runtime/render.ts
79+
/**
80+
* @fixme Trailing render WILL NOT invoke AFTER_RENDER, only main render will invoke AFTER_RENDER.
81+
* But in fact, should the last trailing render invoke AFTER_RENDER.
82+
* Which will cause a problem when there is multiple render in short time, AFTER_RENDER will not invoke in correct time.
83+
* @ref src/runtime/render.ts
84+
*/
8185
const finished = new Promise<Runtime<Spec>>((resolve, reject) =>
8286
render(
8387
this._computedOptions(),
@@ -91,6 +95,7 @@ export class Runtime<Spec extends G2Spec = G2Spec> extends CompositionNode {
9195
.then(resolve)
9296
.catch(reject)
9397
.then(() => this._renderTrailing());
98+
9499
return finished1;
95100
}
96101

src/shape/label/label.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export const Label: SC<LabelOptions> = (options, context) => {
8080
.call(applyStyle, defaultStyle)
8181
.style('text', `${text}`)
8282
.style('className', `${className} g2-label`)
83+
.style('visibility', `visible`)
8384
.style(
8485
'innerHTML',
8586
render ? render(text, value.datum, value.index) : undefined,

0 commit comments

Comments
 (0)