@10yun/cv-mobile-ui 0.5.50 → 0.5.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/common_func.js +3 -1
- package/build/parse-create.js +17 -8
- package/build/parse-pages-pkg.js +10 -4
- package/empty-devtools.js +3 -0
- package/libs/aes.js +50 -0
- package/libs/bledefine/bledefine.js +51 -0
- package/libs/bledefine/ios-ble-statuscode.js +97 -0
- package/libs/nfc/hexiii-nfc.js +236 -0
- package/libs/nfc.js +179 -0
- package/libs/sdk/html2canvas.js +8 -0
- package/libs/sdk/sdk-h5.js +585 -0
- package/{plugins → libs}/storage2.js +0 -5
- package/{plugins → libs}/storage3.js +0 -4
- package/libs/validators/index.js +438 -0
- package/libs/weapp-qrcode.js +1108 -0
- package/package.json +2 -3
- package/ui-cv/components/cv-dialog-share/tui-share.vue +16 -16
- package/ui-cv/components/cv-mask-png/cv-mask-png.vue +27 -0
- package/ui-cv/components/cv-mask-svg/cv-mask-svg.vue +22 -0
- package/ui-cv/components/cv-mask-svg/mixins.js +131 -0
- package/ui-fireui/components/{fui-actionsheet/fui-actionsheet.vue → u-action-sheet/u-action-sheet.vue} +21 -21
- package/ui-fireui/components/{fui-alert/fui-alert.vue → u-alert/u-alert.vue} +13 -13
- package/ui-fireui/components/{fui-badge/fui-badge.vue → u-badge/u-badge.vue} +16 -16
- package/ui-fireui/components/{fui-bottom-navigation/fui-bottom-navigation.vue → u-bottom-navigation/u-bottom-navigation.vue} +47 -46
- package/ui-fireui/components/{fui-bottom-popup/fui-bottom-popup.vue → u-bottom-popup/u-bottom-popup.vue} +9 -8
- package/ui-fireui/components/{fui-bubble-popup/fui-bubble-popup.vue → u-bubble-popup/u-bubble-popup.vue} +19 -15
- package/ui-fireui/components/{fui-button/fui-button.vue → u-button/u-button.vue} +69 -69
- package/ui-fireui/components/u-button/u-button2.vue +553 -0
- package/ui-fireui/components/{fui-calendar/fui-calendar.vue → u-calendar/u-calendar.vue} +78 -78
- package/ui-fireui/components/u-calendar/u-calendar2.vue +801 -0
- package/ui-fireui/components/{fui-card/fui-card.vue → u-card/u-card.vue} +24 -24
- package/ui-fireui/components/{fui-cascade-selection/fui-cascade-selection.vue → u-cascade-selection/u-cascade-selection.vue} +32 -32
- package/ui-fireui/components/{fui-circular-progress/fui-circular-progress.vue → u-circular-progress/u-circular-progress.vue} +14 -6
- package/ui-fireui/components/{fui-collapse/fui-collapse.vue → u-collapse/u-collapse.vue} +19 -19
- package/ui-fireui/components/{fui-countdown/fui-countdown.vue → u-countdown/u-countdown.vue} +28 -28
- package/ui-fireui/components/{fui-datetime/fui-datetime.vue → u-datetime/u-datetime.vue} +51 -51
- package/ui-fireui/components/{fui-divider/fui-divider.vue → u-divider/u-divider.vue} +6 -6
- package/ui-fireui/components/{fui-drawer/fui-drawer.vue → u-drawer/u-drawer.vue} +11 -11
- package/ui-fireui/components/{fui-dropdown-list/fui-dropdown-list.vue → u-dropdown-list/u-dropdown-list.vue} +11 -6
- package/ui-fireui/components/{fui-fab/fui-fab.vue → u-fab/u-fab.vue} +30 -30
- package/ui-fireui/components/{fui-footer/fui-footer.vue → u-footer/u-footer.vue} +19 -15
- package/ui-fireui/components/{fui-grid/fui-grid.vue → u-grid/u-grid.vue} +13 -5
- package/ui-fireui/components/{fui-grid-item/fui-grid-item.vue → u-grid-item/u-grid-item.vue} +19 -19
- package/ui-fireui/components/{fui-icon/fui-icon.vue → u-icon/u-icon.vue} +191 -191
- package/ui-fireui/components/{fui-image-cropper/fui-image-cropper.vue → u-image-cropper/u-image-cropper.vue} +44 -44
- package/ui-fireui/components/{fui-image-group/fui-image-group.vue → u-image-group/u-image-group.vue} +7 -7
- package/ui-fireui/components/{fui-keyboard/fui-keyboard.vue → u-keyboard/u-keyboard.vue} +29 -32
- package/ui-fireui/components/{fui-keyboard-input/fui-keyboard-input.vue → u-keyboard-input/u-keyboard-input.vue} +9 -9
- package/ui-fireui/components/{fui-list-cell/fui-list-cell.vue → u-list-cell/u-list-cell.vue} +23 -23
- package/ui-fireui/components/{fui-list-view/fui-list-view.vue → u-list-view/u-list-view.vue} +11 -11
- package/ui-fireui/components/{fui-loading/fui-loading.vue → u-loading/u-loading.vue} +6 -6
- package/ui-fireui/components/{fui-loadmore/fui-loadmore.vue → u-loadmore/u-loadmore.vue} +15 -15
- package/ui-fireui/components/{fui-modal/fui-modal.vue → u-modal/u-modal.vue} +58 -58
- package/ui-fireui/components/{fui-navigation-bar/fui-navigation-bar.vue → u-navigation-bar/u-navigation-bar.vue} +11 -10
- package/ui-fireui/components/{fui-no-data/fui-no-data.vue → u-no-data/u-no-data.vue} +11 -11
- package/ui-fireui/components/{fui-nomore/fui-nomore.vue → u-nomore/u-nomore.vue} +10 -10
- package/ui-fireui/components/{fui-numberbox/fui-numberbox.vue → u-numberbox/u-numberbox.vue} +12 -12
- package/ui-fireui/components/{fui-numberbox-border/fui-numberbox-border.vue → u-numberbox-border/u-numberbox-border.vue} +10 -10
- package/ui-fireui/components/{fui-picture-cropper/fui-picture-cropper.vue → u-picture-cropper/u-picture-cropper.vue} +42 -42
- package/ui-fireui/components/u-picture-cropper/u-picture-cropper.wxs +582 -0
- package/ui-fireui/components/{fui-round-progress/fui-round-progress.vue → u-round-progress/u-round-progress.vue} +2 -2
- package/ui-fireui/components/{fui-scroll-top/fui-scroll-top.vue → u-scroll-top/u-scroll-top.vue} +21 -21
- package/ui-fireui/components/{fui-sharemodel/fui-sharemodel.vue → u-share-model/u-share-model.vue} +24 -24
- package/ui-fireui/components/{fui-skeleton/fui-skeleton.vue → u-skeleton/u-skeleton.vue} +22 -22
- package/ui-fireui/components/{fui-steps/fui-steps.vue → u-steps/u-steps.vue} +27 -27
- package/ui-fireui/components/{fui-sticky/fui-sticky.vue → u-sticky/u-sticky.vue} +4 -4
- package/ui-fireui/components/{fui-sticky-wxs/fui-sticky-wxs.vue → u-sticky-wxs/u-sticky-wxs.vue} +7 -7
- package/ui-fireui/components/u-sticky-wxs/u-sticky.wxs +46 -0
- package/ui-fireui/components/{fui-swipe-action/fui-swipe-action.vue → u-swipe-action/u-swipe-action.vue} +11 -11
- package/ui-fireui/components/{fui-tabbar/fui-tabbar.vue → u-tabbar/u-tabbar.vue} +26 -30
- package/ui-fireui/components/{fui-tabs/fui-tabs.vue → u-tabs/u-tabs.vue} +17 -17
- package/ui-fireui/components/{fui-tabs2/fui-tabs2.vue → u-tabs2/u-tabs2.vue} +17 -17
- package/ui-fireui/components/{fui-tag/fui-tag.vue → u-tag/u-tag.vue} +362 -374
- package/ui-fireui/components/{fui-time-axis/fui-time-axis.vue → u-time-axis/u-time-axis.vue} +3 -3
- package/ui-fireui/components/{fui-timeaxis-item/fui-timeaxis-item.vue → u-timeaxis-item/u-timeaxis-item.vue} +4 -4
- package/ui-fireui/components/{fui-tips/fui-tips.vue → u-tips/u-tips.vue} +20 -20
- package/ui-fireui/components/{fui-toast/fui-toast.vue → u-toast/u-toast.vue} +13 -13
- package/ui-fireui/components/{fui-top-dropdown/fui-top-dropdown.vue → u-top-dropdown/u-top-dropdown.vue} +8 -8
- package/ui-fireui/components/{fui-upload/fui-upload.vue → u-upload/u-upload.vue} +30 -30
- package/ui-fireui/components/u-upload2/u-upload.vue +464 -0
- package/ui-fireui/components/{fui-uploadsamll/fui-uploadsamll.vue → u-uploadsamll/u-uploadsamll.vue} +34 -34
- package/ui-fireui/css/thorui.css +589 -0
- package/ui-fireui/{fireui.css → index.css} +306 -268
- package/ui-fireui/nvue/u-circular-progress/gcanvas/bridge/bridge-weex.js +241 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-2d/FillStyleLinearGradient.js +18 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-2d/FillStylePattern.js +8 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-2d/FillStyleRadialGradient.js +17 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-2d/RenderingContext.js +666 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/ActiveInfo.js +11 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Buffer.js +21 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Framebuffer.js +21 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/GLenum.js +298 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/GLmethod.js +142 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/GLtype.js +23 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Program.js +21 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Renderbuffer.js +21 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/RenderingContext.js +1191 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Shader.js +22 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/ShaderPrecisionFormat.js +11 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/Texture.js +22 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/UniformLocation.js +22 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/context-webgl/classUtils.js +3 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/env/canvas.js +74 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/env/image.js +96 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/env/tool.js +24 -0
- package/ui-fireui/nvue/u-circular-progress/gcanvas/index.js +47 -0
- package/ui-fireui/nvue/u-circular-progress/u-circular-progress.nvue +203 -0
- package/ui-fireui/nvue/u-icon/icons.js +188 -0
- package/ui-fireui/nvue/u-icon/u-icon.vue +78 -0
- package/uview-plus/components/u-grid/u-grid.vue +23 -1
- package/ui-fireui/components/fui-picture-cropper/fui-picture-cropper.wxs +0 -560
- package/ui-fireui/components/fui-rate/fui-rate.vue +0 -167
- package/ui-fireui/components/fui-sticky-wxs/fui-sticky.wxs +0 -44
- /package/ui-fireui/components/{fui-calendar/fui-calendar.js → u-calendar/u-calendar.js} +0 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
const isWeex = typeof WXEnvironment !== 'undefined';
|
|
2
|
+
const isWeexIOS = isWeex && /ios/i.test(WXEnvironment.platform);
|
|
3
|
+
const isWeexAndroid = isWeex && !isWeexIOS;
|
|
4
|
+
|
|
5
|
+
import GLmethod from '../context-webgl/GLmethod';
|
|
6
|
+
|
|
7
|
+
const GCanvasModule =
|
|
8
|
+
(typeof weex !== 'undefined' && weex.requireModule) ? (weex.requireModule('gcanvas')) :
|
|
9
|
+
(typeof __weex_require__ !== 'undefined') ? (__weex_require__('@weex-module/gcanvas')) : {};
|
|
10
|
+
|
|
11
|
+
let isDebugging = false;
|
|
12
|
+
|
|
13
|
+
let isComboDisabled = false;
|
|
14
|
+
|
|
15
|
+
const logCommand = (function () {
|
|
16
|
+
const methodQuery = [];
|
|
17
|
+
Object.keys(GLmethod).forEach(key => {
|
|
18
|
+
methodQuery[GLmethod[key]] = key;
|
|
19
|
+
})
|
|
20
|
+
const queryMethod = (id) => {
|
|
21
|
+
return methodQuery[parseInt(id)] || 'NotFoundMethod';
|
|
22
|
+
}
|
|
23
|
+
const logCommand = (id, cmds) => {
|
|
24
|
+
const mId = cmds.split(',')[0];
|
|
25
|
+
const mName = queryMethod(mId);
|
|
26
|
+
console.log(`=== callNative - componentId:${id}; method: ${mName}; cmds: ${cmds}`);
|
|
27
|
+
}
|
|
28
|
+
return logCommand;
|
|
29
|
+
})();
|
|
30
|
+
|
|
31
|
+
function joinArray(arr, sep) {
|
|
32
|
+
let res = '';
|
|
33
|
+
for (let i = 0; i < arr.length; i++) {
|
|
34
|
+
if (i !== 0) {
|
|
35
|
+
res += sep;
|
|
36
|
+
}
|
|
37
|
+
res += arr[i];
|
|
38
|
+
}
|
|
39
|
+
return res;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const commandsCache = {}
|
|
43
|
+
|
|
44
|
+
const GBridge = {
|
|
45
|
+
|
|
46
|
+
callEnable: (ref, configArray) => {
|
|
47
|
+
|
|
48
|
+
commandsCache[ref] = [];
|
|
49
|
+
|
|
50
|
+
return GCanvasModule.enable({
|
|
51
|
+
componentId: ref,
|
|
52
|
+
config: configArray
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
callEnableDebug: () => {
|
|
57
|
+
isDebugging = true;
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
callEnableDisableCombo: () => {
|
|
61
|
+
isComboDisabled = true;
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
callSetContextType: function (componentId, context_type) {
|
|
65
|
+
GCanvasModule.setContextType(context_type, componentId);
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
callReset: function(id){
|
|
69
|
+
GCanvasModule.resetComponent && canvasModule.resetComponent(componentId);
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
render: isWeexIOS ? function (componentId) {
|
|
73
|
+
return GCanvasModule.extendCallNative({
|
|
74
|
+
contextId: componentId,
|
|
75
|
+
type: 0x60000001
|
|
76
|
+
});
|
|
77
|
+
} : function (componentId) {
|
|
78
|
+
return callGCanvasLinkNative(componentId, 0x60000001, 'render');
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
render2d: isWeexIOS ? function (componentId, commands, callback) {
|
|
82
|
+
|
|
83
|
+
if (isDebugging) {
|
|
84
|
+
console.log('>>> >>> render2d ===');
|
|
85
|
+
console.log('>>> commands: ' + commands);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
GCanvasModule.render([commands, callback?true:false], componentId, callback);
|
|
89
|
+
|
|
90
|
+
} : function (componentId, commands,callback) {
|
|
91
|
+
|
|
92
|
+
if (isDebugging) {
|
|
93
|
+
console.log('>>> >>> render2d ===');
|
|
94
|
+
console.log('>>> commands: ' + commands);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
callGCanvasLinkNative(componentId, 0x20000001, commands);
|
|
98
|
+
if(callback){
|
|
99
|
+
callback();
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
callExtendCallNative: isWeexIOS ? function (componentId, cmdArgs) {
|
|
104
|
+
|
|
105
|
+
throw 'should not be here anymore ' + cmdArgs;
|
|
106
|
+
|
|
107
|
+
} : function (componentId, cmdArgs) {
|
|
108
|
+
|
|
109
|
+
throw 'should not be here anymore ' + cmdArgs;
|
|
110
|
+
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
flushNative: isWeexIOS ? function (componentId) {
|
|
115
|
+
|
|
116
|
+
const cmdArgs = joinArray(commandsCache[componentId], ';');
|
|
117
|
+
commandsCache[componentId] = [];
|
|
118
|
+
|
|
119
|
+
if (isDebugging) {
|
|
120
|
+
console.log('>>> >>> flush native ===');
|
|
121
|
+
console.log('>>> commands: ' + cmdArgs);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const result = GCanvasModule.extendCallNative({
|
|
125
|
+
"contextId": componentId,
|
|
126
|
+
"type": 0x60000000,
|
|
127
|
+
"args": cmdArgs
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
const res = result && result.result;
|
|
131
|
+
|
|
132
|
+
if (isDebugging) {
|
|
133
|
+
console.log('>>> result: ' + res);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return res;
|
|
137
|
+
|
|
138
|
+
} : function (componentId) {
|
|
139
|
+
|
|
140
|
+
const cmdArgs = joinArray(commandsCache[componentId], ';');
|
|
141
|
+
commandsCache[componentId] = [];
|
|
142
|
+
|
|
143
|
+
if (isDebugging) {
|
|
144
|
+
console.log('>>> >>> flush native ===');
|
|
145
|
+
console.log('>>> commands: ' + cmdArgs);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const result = callGCanvasLinkNative(componentId, 0x60000000, cmdArgs);
|
|
149
|
+
|
|
150
|
+
if (isDebugging) {
|
|
151
|
+
console.log('>>> result: ' + result);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return result;
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
callNative: function (componentId, cmdArgs, cache) {
|
|
158
|
+
|
|
159
|
+
if (isDebugging) {
|
|
160
|
+
logCommand(componentId, cmdArgs);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
commandsCache[componentId].push(cmdArgs);
|
|
164
|
+
|
|
165
|
+
if (!cache || isComboDisabled) {
|
|
166
|
+
return GBridge.flushNative(componentId);
|
|
167
|
+
} else {
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
texImage2D(componentId, ...args) {
|
|
173
|
+
if (isWeexIOS) {
|
|
174
|
+
if (args.length === 6) {
|
|
175
|
+
const [target, level, internalformat, format, type, image] = args;
|
|
176
|
+
GBridge.callNative(
|
|
177
|
+
componentId,
|
|
178
|
+
GLmethod.texImage2D + ',' + 6 + ',' + target + ',' + level + ',' + internalformat + ',' + format + ',' + type + ',' + image.src
|
|
179
|
+
)
|
|
180
|
+
} else if (args.length === 9) {
|
|
181
|
+
const [target, level, internalformat, width, height, border, format, type, image] = args;
|
|
182
|
+
GBridge.callNative(
|
|
183
|
+
componentId,
|
|
184
|
+
GLmethod.texImage2D + ',' + 9 + ',' + target + ',' + level + ',' + internalformat + ',' + width + ',' + height + ',' + border + ',' +
|
|
185
|
+
+ format + ',' + type + ',' + (image ? image.src : 0)
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
} else if (isWeexAndroid) {
|
|
189
|
+
if (args.length === 6) {
|
|
190
|
+
const [target, level, internalformat, format, type, image] = args;
|
|
191
|
+
GCanvasModule.texImage2D(componentId, target, level, internalformat, format, type, image.src);
|
|
192
|
+
} else if (args.length === 9) {
|
|
193
|
+
const [target, level, internalformat, width, height, border, format, type, image] = args;
|
|
194
|
+
GCanvasModule.texImage2D(componentId, target, level, internalformat, width, height, border, format, type, (image ? image.src : 0));
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
texSubImage2D(componentId, target, level, xoffset, yoffset, format, type, image) {
|
|
200
|
+
if (isWeexIOS) {
|
|
201
|
+
if (arguments.length === 8) {
|
|
202
|
+
GBridge.callNative(
|
|
203
|
+
componentId,
|
|
204
|
+
GLmethod.texSubImage2D + ',' + 6 + ',' + target + ',' + level + ',' + xoffset + ',' + yoffset, + ',' + format + ',' + type + ',' + image.src
|
|
205
|
+
)
|
|
206
|
+
}
|
|
207
|
+
} else if (isWeexAndroid) {
|
|
208
|
+
GCanvasModule.texSubImage2D(componentId, target, level, xoffset, yoffset, format, type, image.src);
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
bindImageTexture(componentId, src, imageId) {
|
|
213
|
+
GCanvasModule.bindImageTexture([src, imageId], componentId);
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
perloadImage([url, id], callback) {
|
|
217
|
+
GCanvasModule.preLoadImage([url, id], function (image) {
|
|
218
|
+
image.url = url;
|
|
219
|
+
image.id = id;
|
|
220
|
+
callback(image);
|
|
221
|
+
});
|
|
222
|
+
},
|
|
223
|
+
|
|
224
|
+
measureText(text, fontStyle, componentId) {
|
|
225
|
+
return GCanvasModule.measureText([text, fontStyle], componentId);
|
|
226
|
+
},
|
|
227
|
+
|
|
228
|
+
getImageData (componentId, x, y, w, h, callback) {
|
|
229
|
+
GCanvasModule.getImageData([x, y,w,h],componentId,callback);
|
|
230
|
+
},
|
|
231
|
+
|
|
232
|
+
putImageData (componentId, data, x, y, w, h, callback) {
|
|
233
|
+
GCanvasModule.putImageData([x, y,w,h,data],componentId,callback);
|
|
234
|
+
},
|
|
235
|
+
|
|
236
|
+
toTempFilePath(componentId, x, y, width, height, destWidth, destHeight, fileType, quality, callback){
|
|
237
|
+
GCanvasModule.toTempFilePath([x, y, width,height, destWidth, destHeight, fileType, quality], componentId, callback);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export default GBridge;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class FillStyleLinearGradient {
|
|
2
|
+
|
|
3
|
+
constructor(x0, y0, x1, y1) {
|
|
4
|
+
this._start_pos = { _x: x0, _y: y0 };
|
|
5
|
+
this._end_pos = { _x: x1, _y: y1 };
|
|
6
|
+
this._stop_count = 0;
|
|
7
|
+
this._stops = [0, 0, 0, 0, 0];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
addColorStop = function (pos, color) {
|
|
11
|
+
if (this._stop_count < 5 && 0.0 <= pos && pos <= 1.0) {
|
|
12
|
+
this._stops[this._stop_count] = { _pos: pos, _color: color };
|
|
13
|
+
this._stop_count++;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default FillStyleLinearGradient;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
class FillStyleRadialGradient {
|
|
2
|
+
constructor(x0, y0, r0, x1, y1, r1) {
|
|
3
|
+
this._start_pos = { _x: x0, _y: y0, _r: r0 };
|
|
4
|
+
this._end_pos = { _x: x1, _y: y1, _r: r1 };
|
|
5
|
+
this._stop_count = 0;
|
|
6
|
+
this._stops = [0, 0, 0, 0, 0];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
addColorStop(pos, color) {
|
|
10
|
+
if (this._stop_count < 5 && 0.0 <= pos && pos <= 1.0) {
|
|
11
|
+
this._stops[this._stop_count] = { _pos: pos, _color: color };
|
|
12
|
+
this._stop_count++;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default FillStyleRadialGradient;
|