Skip to content

Commit

Permalink
chore: 0.85
Browse files Browse the repository at this point in the history
  • Loading branch information
army8735 committed Jan 5, 2023
1 parent cdec047 commit fb51a65
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 10 deletions.
32 changes: 28 additions & 4 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,8 @@ console.log(root.getTargetAtPoint(10, 10)); // { target: span, path: [0, 0], zPa
#### draw
* **类型** `Function`
* **参数**
* isFirst `Boolean` 是否第一次,在append到真实DOM上的时候默认true
* isFirst `Boolean`
是否第一次,在append到真实DOM上的时候默认true。
* * **说明**
强制刷新这个画布实例。

Expand All @@ -993,9 +994,12 @@ console.log(root.getTargetAtPoint(10, 10)); // { target: span, path: [0, 0], zPa

#### resize
* **参数**
* w `Number`
* h `Number`
* cb `Function` 回调
* w `Number`
宽。
* h `Number`
高。
* cb `Function`
回调。
* **说明**
重新调整画布尺寸大小。

Expand Down Expand Up @@ -1206,6 +1210,26 @@ karas.render(
* **说明**
修改图片的url。

### 静态方法

#### toWebglCache
* **类型** `Function`
* **参数**
* gl `WebGLContext`
webgl的上下文。
* root `Root`
根节点。
* src `String`
图片url。
* x `Number`
x位置。
* y `Number`
y位置。
* cb `Function`
成功回调。
* **说明**
将一张图片转为webgl的缓存纹理以供渲染。

<a name="Component"></a>
## Component
* **类型** `class`
Expand Down
3 changes: 3 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ declare namespace karas {

getTargetAtPoint(x: number, y: number, includeIgnore: boolean): Node | Component | null

freeze(): void

unFreeze(): void
get dom(): HTMLElement

get uuid(): number
Expand Down
18 changes: 15 additions & 3 deletions index.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -37585,6 +37585,7 @@ var Root = /*#__PURE__*/function (_Dom) {

_this.__task = [];
_this.__ref = {};
_this.__freeze = false;
_this.__animateController = new Controller();
Event.mix(_assertThisInitialized(_this));
_this.__uuid = uuid++;
Expand Down Expand Up @@ -37890,9 +37891,10 @@ var Root = /*#__PURE__*/function (_Dom) {

if (isFirst) {
this.__reLayout();
}
} // freeze()冻住不渲染,但第一次不能生效


if (this.props.noRender) {
if (this.props.noRender || !isFirst && this.__freeze) {
return;
}

Expand Down Expand Up @@ -38441,6 +38443,16 @@ var Root = /*#__PURE__*/function (_Dom) {
ctx.clearColor(0, 0, 0, 0);
ctx.clear(ctx.COLOR_BUFFER_BIT);
}
}, {
key: "freeze",
value: function freeze() {
this.__freeze = true;
}
}, {
key: "unFreeze",
value: function unFreeze() {
this.__freeze = false;
}
}, {
key: "dom",
get: function get() {
Expand Down Expand Up @@ -44770,7 +44782,7 @@ var refresh = {
webgl: webgl
};

var version = "0.84.7";
var version = "0.85.0";

Geom.register('$line', Line);
Geom.register('$polyline', Polyline);
Expand Down
2 changes: 1 addition & 1 deletion index.es.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44788,7 +44788,7 @@
webgl: webgl
};

var version = "0.84.7";
var version = "0.85.0";

Geom.register('$line', Line);
Geom.register('$polyline', Polyline);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "karas",
"version": "0.84.7",
"version": "0.85.0",
"description": "A flexible JavaScript framework for RIA on Canvas/Svg/Webgl.",
"maintainers": [
{
Expand Down

0 comments on commit fb51a65

Please sign in to comment.