From b2c19d3242f84435e52e14cfd31a57fdede5511e Mon Sep 17 00:00:00 2001 From: MrRaindrop Date: Tue, 31 Oct 2017 22:15:05 +0800 Subject: [PATCH 1/4] * [html5] bugfix: - fix waterfall: use headers below cells as footers. - fix issue WEEX-97. - fix click handler being invoked twice for switch. --- html5/render/vue/README.md | 6 ++- .../vue/components/scrollable/waterfall.js | 45 ++++++++++++++++--- html5/render/vue/components/switch.js | 27 ++++++++--- html5/render/vue/core/style.js | 24 ++++++---- package.json | 2 +- packages/weex-vue-render/README.md | 6 ++- packages/weex-vue-render/package.json | 2 +- 7 files changed, 86 insertions(+), 26 deletions(-) diff --git a/html5/render/vue/README.md b/html5/render/vue/README.md index 6af6a37ee1..ed83f59b8a 100644 --- a/html5/render/vue/README.md +++ b/html5/render/vue/README.md @@ -193,11 +193,15 @@ vue: { * fix image lazyloading. -#### 0.12.23 +#### 0.12.24 * add try catch to accessing localStorage. * support image sprite. +#### 0.12.25 + +* fix indicator position in one page slider. + ## component -> dom map | component | dom element | children | note | diff --git a/html5/render/vue/components/scrollable/waterfall.js b/html5/render/vue/components/scrollable/waterfall.js index 90529944db..325fe02614 100644 --- a/html5/render/vue/components/scrollable/waterfall.js +++ b/html5/render/vue/components/scrollable/waterfall.js @@ -93,7 +93,38 @@ function getWaterfall (weex) { _createChildren (h, rootStyle) { const slots = this.$slots.default || [] this._headers = [] + this._footers = [] this._others = [] + const len = slots.length + + for (let i = 0; i < len; i++) { + const vnode = slots[i] + const tag = vnode.componentOptions && vnode.componentOptions.tag + if (tag === 'refresh' || tag === 'loading') { + continue + } + if (tag === 'cell') { + break + } + if (tag === 'header') { + this._headers.push(vnode) + } + } + + for (let i = len - 1; i >= 0; i--) { + const vnode = slots[i] + const tag = vnode.componentOptions && vnode.componentOptions.tag + if (tag === 'refresh' || tag === 'loading') { + continue + } + if (tag === 'cell') { + break + } + if (tag === 'header') { + this._footers.push(vnode) + } + } + this._cells = slots.filter(vnode => { if (!vnode.tag || !vnode.componentOptions) return false const tag = vnode.componentOptions.tag @@ -101,27 +132,27 @@ function getWaterfall (weex) { this[`_${tag}`] = vnode return false } - if (tag === 'header') { - this._headers.push(vnode) - return false - } if (tag !== 'cell') { this._others.push(vnode) return false } return true }) + this._reCalc(rootStyle) this._genColumns(h) let children = [] this._refresh && children.push(this._refresh) - children = children - .concat(this._headers) - .concat(this._others) + children = children.concat(this._headers) + // .concat(this._others) children.push(h('html:div', { ref: 'columns', staticClass: 'weex-waterfall-inner-columns weex-ct' }, this._columns)) + children.push(h('html:div', { + ref: 'footers', + staticClass: 'weex-waterfall-footers weex-ct' + }, this._footers)) this._loading && children.push(this._loading) return [ h('article', { diff --git a/html5/render/vue/components/switch.js b/html5/render/vue/components/switch.js index 7f9562a8bb..11faa63674 100644 --- a/html5/render/vue/components/switch.js +++ b/html5/render/vue/components/switch.js @@ -115,6 +115,27 @@ function getSwitch (weex) { } }, + mounted () { + const el = this.$el + if (el && el.nodeType === 1) { + if (!this._removeClickHandler) { + const handler = evt => { + this.toggle() + } + this._removeClickHandler = el.removeEventListener.bind(el, 'click', handler) + el.addEventListener('click', handler) + } + } + }, + + beforeDestroy () { + const rm = this._removeClickHandler + if (rm) { + rm() + delete this._removeClickHandler + } + }, + render (createElement) { /* istanbul ignore next */ // if (process.env.NODE_ENV === 'development') { @@ -122,12 +143,6 @@ function getSwitch (weex) { // } return createElement('span', { attrs: { 'weex-type': 'switch' }, - on: { - click: event => { - this.$emit('click', event) - this.toggle() - } - }, staticClass: this.wrapperClass, staticStyle: extractComponentStyle(this) }, [createElement('small', { staticClass: 'weex-switch-inner' })]) diff --git a/html5/render/vue/core/style.js b/html5/render/vue/core/style.js index 691849b0b1..24184e0d8f 100644 --- a/html5/render/vue/core/style.js +++ b/html5/render/vue/core/style.js @@ -225,13 +225,13 @@ export function getComponentStyle (context, extract) { } return {} } - let style = {} + const style = {} let vnode = context.$vnode while (vnode) { extend(style, getStyle(vnode, extract)) vnode = vnode.parent } - style = autoPrefix(style) + const prefixedStyle = autoPrefix(style) /** * when prefixed value is a array, it should be applied to element * during the next tick. @@ -245,9 +245,9 @@ export function getComponentStyle (context, extract) { * "linear-gradient(to top,#f5fefd,#ffffff)"] * } */ - for (const k in style) { - if (Array.isArray(style[k])) { - const vals = style[k] + for (const k in prefixedStyle) { + if (Array.isArray(prefixedStyle[k])) { + const vals = prefixedStyle[k] context.$nextTick(function () { const el = context.$el if (el) { @@ -256,14 +256,20 @@ export function getComponentStyle (context, extract) { } } }) - if (k !== 'position') { delete style[k] } + if (k !== 'position') { + /** + * Should not delete prefixedStyle[k] directly. Otherwise will + * trigger issue: https://issues.apache.org/jira/projects/WEEX/issues/WEEX-97 + */ + prefixedStyle[k] = style[k] + } } } /** * If position is 'sticky', then add it to the stickyChildren of the parent scroller. */ - const pos = style.position + const pos = prefixedStyle.position const reg = /sticky$/ if (pos === 'fixed') { context.$nextTick(function () { @@ -274,7 +280,7 @@ export function getComponentStyle (context, extract) { }) } else if (isArray(pos) && pos[0].match(reg) || (pos + '').match(reg)) { - delete style.position + delete prefixedStyle.position // use native sticky. if (supportSticky()) { context.$nextTick(function () { @@ -304,7 +310,7 @@ export function getComponentStyle (context, extract) { } } - return style + return prefixedStyle } export function extractComponentStyle (context) { diff --git a/package.json b/package.json index 0460403490..e3eea1cf08 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "subversion": { "browser": "0.5.0", "framework": "0.22.4", - "vue-render": "0.12.24", + "vue-render": "0.12.25", "transformer": ">=0.1.5 <0.5" }, "description": "A framework for building Mobile cross-platform UI", diff --git a/packages/weex-vue-render/README.md b/packages/weex-vue-render/README.md index 6af6a37ee1..ed83f59b8a 100644 --- a/packages/weex-vue-render/README.md +++ b/packages/weex-vue-render/README.md @@ -193,11 +193,15 @@ vue: { * fix image lazyloading. -#### 0.12.23 +#### 0.12.24 * add try catch to accessing localStorage. * support image sprite. +#### 0.12.25 + +* fix indicator position in one page slider. + ## component -> dom map | component | dom element | children | note | diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json index e54f49b30c..3b0e034fa9 100644 --- a/packages/weex-vue-render/package.json +++ b/packages/weex-vue-render/package.json @@ -1,6 +1,6 @@ { "name": "weex-vue-render", - "version": "0.12.24", + "version": "0.12.25", "description": "Weex built-in components for Vue 2.x.", "license": "Apache-2.0", "main": "dist/index.common.js", From dedc97575b1f94e9e69122f3ffe53618b59955a3 Mon Sep 17 00:00:00 2001 From: CYJB Date: Thu, 23 Nov 2017 12:11:15 +0800 Subject: [PATCH 2/4] [WEEX-139][ios]Provide system language infomation Provide locale module, contains information about system language. Example: [http://dotwe.org/vue/fc5e91d6f1a809bab2f073af53f4dd94] --- ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 12 ++++++ ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m | 1 + .../WeexSDK/Sources/Module/WXLocaleModule.h | 27 ++++++++++++ .../WeexSDK/Sources/Module/WXLocaleModule.m | 41 +++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 ios/sdk/WeexSDK/Sources/Module/WXLocaleModule.h create mode 100644 ios/sdk/WeexSDK/Sources/Module/WXLocaleModule.m diff --git a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj index f728c40bc0..facb2250d9 100644 --- a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj +++ b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj @@ -269,6 +269,10 @@ 841CD1061F974DFA0081196D /* WXExceptionUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 841CD1041F97399C0081196D /* WXExceptionUtils.h */; settings = {ATTRIBUTES = (Public, ); }; }; 841CD1071F974E000081196D /* WXExceptionUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 841CD1021F9739890081196D /* WXExceptionUtils.m */; }; 9B9E74791FA2DB5800DAAEA9 /* WXTestBridgeMethodDummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B9E74781FA2DB5800DAAEA9 /* WXTestBridgeMethodDummy.m */; }; + BA5F00F11FC5AFFE00F76B5C /* WXLocaleModule.h in Headers */ = {isa = PBXBuildFile; fileRef = BA5F00EF1FC5AFFE00F76B5C /* WXLocaleModule.h */; }; + BA5F00F21FC5AFFE00F76B5C /* WXLocaleModule.m in Sources */ = {isa = PBXBuildFile; fileRef = BA5F00F01FC5AFFE00F76B5C /* WXLocaleModule.m */; }; + BA5F00F31FC6834900F76B5C /* WXLocaleModule.h in Headers */ = {isa = PBXBuildFile; fileRef = BA5F00EF1FC5AFFE00F76B5C /* WXLocaleModule.h */; }; + BA5F00F41FC6834C00F76B5C /* WXLocaleModule.m in Sources */ = {isa = PBXBuildFile; fileRef = BA5F00F01FC5AFFE00F76B5C /* WXLocaleModule.m */; }; C401945E1E344E8300D19C31 /* WXFloatCompareTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C401945D1E344E8300D19C31 /* WXFloatCompareTests.m */; }; C41E1A971DC1FD15009C7F90 /* WXDatePickerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = C41E1A951DC1FD15009C7F90 /* WXDatePickerManager.h */; }; C41E1A981DC1FD15009C7F90 /* WXDatePickerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C41E1A961DC1FD15009C7F90 /* WXDatePickerManager.m */; }; @@ -860,6 +864,8 @@ 841CD1041F97399C0081196D /* WXExceptionUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WXExceptionUtils.h; sourceTree = ""; }; 9B9E74771FA2DB5800DAAEA9 /* WXTestBridgeMethodDummy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXTestBridgeMethodDummy.h; sourceTree = ""; }; 9B9E74781FA2DB5800DAAEA9 /* WXTestBridgeMethodDummy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXTestBridgeMethodDummy.m; sourceTree = ""; }; + BA5F00EF1FC5AFFE00F76B5C /* WXLocaleModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WXLocaleModule.h; sourceTree = ""; }; + BA5F00F01FC5AFFE00F76B5C /* WXLocaleModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WXLocaleModule.m; sourceTree = ""; }; C401945D1E344E8300D19C31 /* WXFloatCompareTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXFloatCompareTests.m; sourceTree = ""; }; C41E1A951DC1FD15009C7F90 /* WXDatePickerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXDatePickerManager.h; sourceTree = ""; }; C41E1A961DC1FD15009C7F90 /* WXDatePickerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXDatePickerManager.m; sourceTree = ""; }; @@ -1411,6 +1417,8 @@ 77E659D71C07F585008B8775 /* Module */ = { isa = PBXGroup; children = ( + BA5F00EF1FC5AFFE00F76B5C /* WXLocaleModule.h */, + BA5F00F01FC5AFFE00F76B5C /* WXLocaleModule.m */, DCE2CF981F46D4220021BDC4 /* WXVoiceOverModule.m */, DCE2CF991F46D4220021BDC4 /* WXVoiceOverModule.h */, 333D9A251F41507A007CED39 /* WXTransition.h */, @@ -1701,6 +1709,7 @@ 74D205201E091B8000128F44 /* WXCallJSMethod.h in Headers */, 741DFE061DDD9B30009B020F /* UIBezierPath+Weex.h in Headers */, 2AAFC1B61C48DFF70026D2FE /* WXSDKError.h in Headers */, + BA5F00F11FC5AFFE00F76B5C /* WXLocaleModule.h in Headers */, 742AD72E1DF98C45007DC46C /* WXResourceRequest.h in Headers */, D317338C1C57257000BB7539 /* WXTransform.h in Headers */, 77D161301C02DE4E0010B15B /* WXComponent.h in Headers */, @@ -1776,6 +1785,7 @@ DCA445EC1EFA5A0E00D0CFA8 /* WXTextAreaComponent.h in Headers */, DCA445D81EFA599400D0CFA8 /* WXRootView.h in Headers */, DCA446131EFA5A8C00D0CFA8 /* WXCallJSMethod.h in Headers */, + BA5F00F31FC6834900F76B5C /* WXLocaleModule.h in Headers */, 74B81AED1F73C3E900D3A61D /* WXCellSlotComponent.h in Headers */, DCA445E41EFA59DC00D0CFA8 /* WXVideoComponent.h in Headers */, DCA4460B1EFA5A7200D0CFA8 /* WXAssert.h in Headers */, @@ -2141,6 +2151,7 @@ 744BEA5A1D0520F300452B5D /* WXComponent+Layout.m in Sources */, 59A582FD1CF5B17B0081FD3E /* WXBridgeContext.m in Sources */, 743933B51C7ED9AA00773BB7 /* WXSimulatorShortcutManager.m in Sources */, + BA5F00F21FC5AFFE00F76B5C /* WXLocaleModule.m in Sources */, 74BB5FBA1DFEE81A004FC3DF /* WXMetaModule.m in Sources */, 741081201CED585A001BC6E5 /* WXComponentManager.m in Sources */, 1D3000F21D40B9AC004F3B4F /* WXClipboardModule.m in Sources */, @@ -2237,6 +2248,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + BA5F00F41FC6834C00F76B5C /* WXLocaleModule.m in Sources */, DCA4452D1EFA55B300D0CFA8 /* WXComponent+Layout.m in Sources */, DCA4452F1EFA55B300D0CFA8 /* WXResourceLoader.m in Sources */, DCA445301EFA55B300D0CFA8 /* WXComponent+Events.m in Sources */, diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m b/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m index fbd62b93f1..4e1d5b7853 100644 --- a/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m +++ b/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m @@ -47,6 +47,7 @@ @implementation WXSDKEngine + (void)_registerDefaultModules { [self registerModule:@"dom" withClass:NSClassFromString(@"WXDomModule")]; + [self registerModule:@"locale" withClass:NSClassFromString(@"WXLocaleModule")]; [self registerModule:@"navigator" withClass:NSClassFromString(@"WXNavigatorModule")]; [self registerModule:@"stream" withClass:NSClassFromString(@"WXStreamModule")]; [self registerModule:@"animation" withClass:NSClassFromString(@"WXAnimationModule")]; diff --git a/ios/sdk/WeexSDK/Sources/Module/WXLocaleModule.h b/ios/sdk/WeexSDK/Sources/Module/WXLocaleModule.h new file mode 100644 index 0000000000..79d9464b39 --- /dev/null +++ b/ios/sdk/WeexSDK/Sources/Module/WXLocaleModule.h @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import +#import "WXModuleProtocol.h" + +/** + Provide system language information. + */ +@interface WXLocaleModule : NSObject +@end diff --git a/ios/sdk/WeexSDK/Sources/Module/WXLocaleModule.m b/ios/sdk/WeexSDK/Sources/Module/WXLocaleModule.m new file mode 100644 index 0000000000..c993ddc19a --- /dev/null +++ b/ios/sdk/WeexSDK/Sources/Module/WXLocaleModule.m @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "WXLocaleModule.h" + +@implementation WXLocaleModule + +WX_EXPORT_METHOD_SYNC(@selector(getLanguage)) +WX_EXPORT_METHOD_SYNC(@selector(getLanguages)) + +/** + Get preferred language of the user + */ +- (NSString *)getLanguage { + return [NSLocale preferredLanguages][0]; +} + +/** + Get an array of strings representing the user's preferred languages + */ +- (NSArray *)getLanguages { + return [NSLocale preferredLanguages]; +} + +@end From caa5c58080da7a89a10e4f746ba8c9a277cca770 Mon Sep 17 00:00:00 2001 From: misakuo Date: Thu, 23 Nov 2017 17:47:08 +0800 Subject: [PATCH 3/4] * [android] fix pseudo status can not restore --- .../main/java/com/taobao/weex/dom/action/UpdateStyleAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/sdk/src/main/java/com/taobao/weex/dom/action/UpdateStyleAction.java b/android/sdk/src/main/java/com/taobao/weex/dom/action/UpdateStyleAction.java index bb19b320ab..ae8920dccf 100644 --- a/android/sdk/src/main/java/com/taobao/weex/dom/action/UpdateStyleAction.java +++ b/android/sdk/src/main/java/com/taobao/weex/dom/action/UpdateStyleAction.java @@ -84,7 +84,7 @@ public void executeDom(DOMActionContext context) { if (!mData.isEmpty()) { - domObject.updateStyle(mData); + domObject.updateStyle(mData, mIsCausedByPesudo); domObject.applyStyle(mData); if(!mData.isEmpty()) { context.postRenderTask(this); From 0535ac6040e80dc85508dea0610d39837d177856 Mon Sep 17 00:00:00 2001 From: doumafang Date: Fri, 17 Nov 2017 14:09:36 +0800 Subject: [PATCH 4/4] * [ios] refix transform's parse bug about translate close #898, close #903, close #907, close #883 * [ios] fix parse translateY * [ios] fix transition transform value incorrect --- .../WeexSDK/Sources/Component/WXTransform.m | 35 ++++++++----------- ios/sdk/WeexSDK/Sources/Module/WXTransition.m | 13 ++++--- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTransform.m b/ios/sdk/WeexSDK/Sources/Component/WXTransform.m index 9e5c362dad..9f79c0ef3d 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXTransform.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXTransform.m @@ -312,7 +312,6 @@ - (void)parseTransformOrigin:(NSString *)cssValue } } } - _originX = [WXLength lengthWithFloat:originX type:typeX]; _originY = [WXLength lengthWithFloat:originY type:typeY]; } @@ -347,6 +346,12 @@ - (void)parsePerspective:(NSArray *)value } - (void)parseTranslate:(NSArray *)value +{ + [self parseTranslatex:@[value[0]]]; + [self parseTranslatey:@[value[1]]]; +} + +- (void)parseTranslatex:(NSArray *)value { WXLength *translateX; double x = [value[0] doubleValue]; @@ -356,30 +361,20 @@ - (void)parseTranslate:(NSArray *)value x = WXPixelScale(x, self.weexInstance.pixelScaleFactor); translateX = [WXLength lengthWithFloat:x type:WXLengthTypeFixed]; } - - WXLength *translateY; - if (value.count > 1) { - double y = [value[1] doubleValue]; - if ([value[1] hasSuffix:@"%"]) { - translateY = [WXLength lengthWithFloat:y type:WXLengthTypePercent]; - } else { - y = WXPixelScale(y, self.weexInstance.pixelScaleFactor); - translateY = [WXLength lengthWithFloat:y type:WXLengthTypeFixed]; - } - } - _translateX = translateX; - _translateY = translateY; -} - -- (void)parseTranslatex:(NSArray *)value -{ - [self parseTranslate:@[value[0], @"0"]]; } - (void)parseTranslatey:(NSArray *)value { - [self parseTranslate:@[@"0", value[0]]]; + WXLength *translateY; + double y = [value[0] doubleValue]; + if ([value[0] hasSuffix:@"%"]) { + translateY = [WXLength lengthWithFloat:y type:WXLengthTypePercent]; + } else { + y = WXPixelScale(y, self.weexInstance.pixelScaleFactor); + translateY = [WXLength lengthWithFloat:y type:WXLengthTypeFixed]; + } + _translateY = translateY; } - (void)parseScale:(NSArray *)value diff --git a/ios/sdk/WeexSDK/Sources/Module/WXTransition.m b/ios/sdk/WeexSDK/Sources/Module/WXTransition.m index 9cae7e54ff..9855f58b84 100644 --- a/ios/sdk/WeexSDK/Sources/Module/WXTransition.m +++ b/ios/sdk/WeexSDK/Sources/Module/WXTransition.m @@ -243,21 +243,20 @@ - (void)_dealTransitionWithProperty:(NSString *)singleProperty styles:(NSDiction info.perValue = @([info.toValue floatValue] - [info.fromValue floatValue]); [_propertyArray addObject:info]; } - if (wxTransform.translateX && [wxTransform.translateX floatValue] !=[oldTransform.translateX floatValue]) { WXTransitionInfo *info = [WXTransitionInfo new]; info.propertyName = @"transform.translation.x"; - info.fromValue = @([oldTransform.translateX valueForMaximum:_targetComponent.view.bounds.size.width]); - info.toValue = @([wxTransform.translateX valueForMaximum:_targetComponent.view.bounds.size.width]); - info.perValue = @([info.toValue floatValue] - [info.fromValue floatValue]); + info.fromValue = @([oldTransform.translateX floatValue]); + info.toValue = @([wxTransform.translateX floatValue]); + info.perValue = @([wxTransform.translateX floatValue] - [oldTransform.translateX floatValue]); [_propertyArray addObject:info]; } if (wxTransform.translateY && [wxTransform.translateY floatValue] !=[oldTransform.translateY floatValue]) { WXTransitionInfo *info = [WXTransitionInfo new]; info.propertyName = @"transform.translation.y"; - info.fromValue = @([oldTransform.translateY valueForMaximum:_targetComponent.view.bounds.size.height]); - info.toValue = @([wxTransform.translateY valueForMaximum:_targetComponent.view.bounds.size.height]); - info.perValue = @([info.toValue floatValue] - [info.fromValue floatValue]); + info.fromValue = @([oldTransform.translateY floatValue]); + info.toValue = @([wxTransform.translateY floatValue]); + info.perValue = @([wxTransform.translateY floatValue] - [oldTransform.translateY floatValue]); [_propertyArray addObject:info]; } _targetComponent->_transform = wxTransform;