Skip to content

Commit

Permalink
fix: cp的__struct设置代理 #104
Browse files Browse the repository at this point in the history
  • Loading branch information
army8735 committed Nov 5, 2020
1 parent 7b78352 commit f9135eb
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js

node_js:
- 12
- 14

before_script:
- nightwatch --version
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
A flexible JavaScript framework for RIA on Canvas/Svg.

[![NPM version](https://img.shields.io/npm/v/karas.svg)](https://npmjs.org/package/karas)
[![Build Status](https://img.shields.io/travis/karasjs/karas.svg)](https://travis-ci.org/karasjs/karas)
[![Build Status](https://api.travis-ci.com/karasjs/karas.svg?branch=master&status=started)](https://travis-ci.com/karasjs/karas)

## INSTALL
```
Expand Down
20 changes: 19 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14748,7 +14748,7 @@
return Component;
}(Event);

Object.keys(o.GEOM).concat(['x', 'y', 'ox', 'oy', 'sx', 'sy', 'width', 'height', 'outerWidth', 'outerHeight', 'innerWidth', 'innerHeight', 'style', 'animationList', 'animateStyle', 'currentStyle', 'computedStyle', 'currentProps', 'baseLine', 'virtualDom', 'mask', 'maskId', 'textWidth', 'content', 'lineBoxes', 'charWidthList', 'charWidth', 'layoutData', 'availableAnimating', 'effectiveAnimating', 'displayAnimating', 'visibilityAnimating', '__refreshLevel', '__cacheTotal', '__cache', 'bbox', '__struct']).forEach(function (fn) {
Object.keys(o.GEOM).concat(['x', 'y', 'ox', 'oy', 'sx', 'sy', 'width', 'height', 'outerWidth', 'outerHeight', 'innerWidth', 'innerHeight', 'style', 'animationList', 'animateStyle', 'currentStyle', 'computedStyle', 'currentProps', 'baseLine', 'virtualDom', 'mask', 'maskId', 'textWidth', 'content', 'lineBoxes', 'charWidthList', 'charWidth', 'layoutData', 'availableAnimating', 'effectiveAnimating', 'displayAnimating', 'visibilityAnimating', '__refreshLevel', '__cacheTotal', '__cache', 'bbox']).forEach(function (fn) {
Object.defineProperty(Component$1.prototype, fn, {
get: function get() {
var sr = this.shadowRoot;
Expand All @@ -14759,6 +14759,24 @@
}
});
});
['__struct'].forEach(function (fn) {
Object.defineProperty(Component$1.prototype, fn, {
get: function get() {
var sr = this.shadowRoot;

if (sr) {
return sr[fn];
}
},
set: function set(v) {
var sr = this.shadowRoot;

if (sr) {
sr[fn] = v;
}
}
});
});
['__layout', '__layoutAbs', '__tryLayInline', '__offsetX', '__offsetY', '__calAutoBasis', '__calMp', '__calAbs', '__renderAsMask', '__renderByMask', '__mp', 'animate', 'removeAnimate', 'clearAnimate', 'updateStyle', 'deepScan', '__cancelCache', '__applyCache', '__mergeBbox', '__structure', '__modifyStruct'].forEach(function (fn) {
Component$1.prototype[fn] = function () {
var sr = this.shadowRoot;
Expand Down
2 changes: 1 addition & 1 deletion index.js.map

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion src/node/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ Object.keys(change.GEOM).concat([
'__cacheTotal',
'__cache',
'bbox',
'__struct',
]).forEach(fn => {
Object.defineProperty(Component.prototype, fn, {
get() {
Expand All @@ -285,6 +284,23 @@ Object.keys(change.GEOM).concat([
});
});

['__struct'].forEach(fn => {
Object.defineProperty(Component.prototype, fn, {
get() {
let sr = this.shadowRoot;
if(sr) {
return sr[fn];
}
},
set(v) {
let sr = this.shadowRoot;
if(sr) {
sr[fn] = v;
}
},
});
});

[
'__layout',
'__layoutAbs',
Expand Down

0 comments on commit f9135eb

Please sign in to comment.