diff --git a/native/.travis.yml b/native/.travis.yml index 26fecdf97d..78013b3ebc 100644 --- a/native/.travis.yml +++ b/native/.travis.yml @@ -10,7 +10,7 @@ before_install: # blocklist branches: only: - - next + - v2.0-release env: global: diff --git a/native/cocos/platform/android/CCCanvasRenderingContext2D-android.cpp b/native/cocos/platform/android/CCCanvasRenderingContext2D-android.cpp index 3dcda0222e..2b707b9c28 100644 --- a/native/cocos/platform/android/CCCanvasRenderingContext2D-android.cpp +++ b/native/cocos/platform/android/CCCanvasRenderingContext2D-android.cpp @@ -349,6 +349,7 @@ void CanvasRenderingContext2D::set__width(float width) // SE_LOGD("CanvasRenderingContext2D::set__width: %f\n", width); __width = width; _isBufferSizeDirty = true; + recreateBufferIfNeeded(); } void CanvasRenderingContext2D::set__height(float height) @@ -356,6 +357,7 @@ void CanvasRenderingContext2D::set__height(float height) // SE_LOGD("CanvasRenderingContext2D::set__height: %f\n", height); __height = height; _isBufferSizeDirty = true; + recreateBufferIfNeeded(); } void CanvasRenderingContext2D::set_lineWidth(float lineWidth) diff --git a/native/cocos/platform/apple/CCCanvasRenderingContext2D-apple.mm b/native/cocos/platform/apple/CCCanvasRenderingContext2D-apple.mm index 3453b0350f..57616d59cc 100644 --- a/native/cocos/platform/apple/CCCanvasRenderingContext2D-apple.mm +++ b/native/cocos/platform/apple/CCCanvasRenderingContext2D-apple.mm @@ -679,6 +679,7 @@ void CanvasRenderingContext2D::set__width(float width) // SE_LOGD("CanvasRenderingContext2D::set__width: %f\n", width); __width = width; _isBufferSizeDirty = true; + recreateBufferIfNeeded(); } void CanvasRenderingContext2D::set__height(float height) @@ -686,6 +687,7 @@ void CanvasRenderingContext2D::set__height(float height) // SE_LOGD("CanvasRenderingContext2D::set__height: %f\n", height); __height = height; _isBufferSizeDirty = true; + recreateBufferIfNeeded(); } void CanvasRenderingContext2D::set_lineWidth(float lineWidth) diff --git a/native/cocos/platform/win32/CCCanvasRenderingContext2D-win32.cpp b/native/cocos/platform/win32/CCCanvasRenderingContext2D-win32.cpp index da14d2ac3f..e4049be07c 100644 --- a/native/cocos/platform/win32/CCCanvasRenderingContext2D-win32.cpp +++ b/native/cocos/platform/win32/CCCanvasRenderingContext2D-win32.cpp @@ -737,6 +737,7 @@ void CanvasRenderingContext2D::set__width(float width) //SE_LOGD("CanvasRenderingContext2D::set__width: %f\n", width); __width = width; _isBufferSizeDirty = true; + recreateBufferIfNeeded(); } void CanvasRenderingContext2D::set__height(float height) @@ -744,6 +745,7 @@ void CanvasRenderingContext2D::set__height(float height) //SE_LOGD("CanvasRenderingContext2D::set__height: %f\n", height); __height = height; _isBufferSizeDirty = true; + recreateBufferIfNeeded(); } void CanvasRenderingContext2D::set_lineWidth(float lineWidth) diff --git a/native/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp b/native/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp index 3a78ffb04e..904b6a6d55 100755 --- a/native/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp +++ b/native/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -101,6 +101,7 @@ void AppDelegate::applicationDidEnterBackground() struct CustomEvent event; event.name = EVENT_COME_TO_BACKGROUND; EventDispatcher::dispatchCustomEvent(&event); + EventDispatcher::dispatchEnterBackgroundEvent(); } // this function will be called when the app is active again @@ -109,4 +110,5 @@ void AppDelegate::applicationWillEnterForeground() struct CustomEvent event; event.name = EVENT_COME_TO_FOREGROUND; EventDispatcher::dispatchCustomEvent(&event); + EventDispatcher::dispatchEnterForegroundEvent(); } diff --git a/native/templates/js-template-link/frameworks/runtime-src/Classes/AppDelegate.cpp b/native/templates/js-template-link/frameworks/runtime-src/Classes/AppDelegate.cpp index 3a78ffb04e..904b6a6d55 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/Classes/AppDelegate.cpp +++ b/native/templates/js-template-link/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -101,6 +101,7 @@ void AppDelegate::applicationDidEnterBackground() struct CustomEvent event; event.name = EVENT_COME_TO_BACKGROUND; EventDispatcher::dispatchCustomEvent(&event); + EventDispatcher::dispatchEnterBackgroundEvent(); } // this function will be called when the app is active again @@ -109,4 +110,5 @@ void AppDelegate::applicationWillEnterForeground() struct CustomEvent event; event.name = EVENT_COME_TO_FOREGROUND; EventDispatcher::dispatchCustomEvent(&event); + EventDispatcher::dispatchEnterForegroundEvent(); }