From 686b9ae179d0b6281e76bdeb787fc8c25b310bde Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 27 Jun 2011 15:22:55 +0800 Subject: [PATCH 1/2] fix the test title --- tests/tests/ParallaxTest/ParallaxTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests/ParallaxTest/ParallaxTest.cpp b/tests/tests/ParallaxTest/ParallaxTest.cpp index 2b29d4b2d0..11210018c1 100644 --- a/tests/tests/ParallaxTest/ParallaxTest.cpp +++ b/tests/tests/ParallaxTest/ParallaxTest.cpp @@ -72,7 +72,7 @@ Parallax1::Parallax1() std::string Parallax1::title() { - return "MotionStreak test (tap screen)"; + return "Parallax: parent and 3 children"; } //------------------------------------------------------------------ From 5e15545dbda625ba5f99cb2ccd9fd3e2af6c5e26 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 27 Jun 2011 16:01:25 +0800 Subject: [PATCH 2/2] [Android] fix an error when string is --- HelloLua/android/src/org/cocos2dx/lib/Cocos2dxBitmap.java | 5 +++++ HelloWorld/android/src/org/cocos2dx/lib/Cocos2dxBitmap.java | 5 +++++ tests/test.android/src/org/cocos2dx/lib/Cocos2dxBitmap.java | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/HelloLua/android/src/org/cocos2dx/lib/Cocos2dxBitmap.java b/HelloLua/android/src/org/cocos2dx/lib/Cocos2dxBitmap.java index 5946e8f72b..894b64416c 100644 --- a/HelloLua/android/src/org/cocos2dx/lib/Cocos2dxBitmap.java +++ b/HelloLua/android/src/org/cocos2dx/lib/Cocos2dxBitmap.java @@ -22,6 +22,11 @@ public class Cocos2dxBitmap{ public static void createTextBitmap(String content, String fontName, int fontSize, int alignment){ + // avoid error when content is "" + if (content.compareTo("") == 0){ + content = " "; + } + Paint paint = newPaint(fontName, fontSize, alignment); TextProperty textProperty = getTextWidthAndHeight(content, paint); diff --git a/HelloWorld/android/src/org/cocos2dx/lib/Cocos2dxBitmap.java b/HelloWorld/android/src/org/cocos2dx/lib/Cocos2dxBitmap.java index 5946e8f72b..894b64416c 100644 --- a/HelloWorld/android/src/org/cocos2dx/lib/Cocos2dxBitmap.java +++ b/HelloWorld/android/src/org/cocos2dx/lib/Cocos2dxBitmap.java @@ -22,6 +22,11 @@ public class Cocos2dxBitmap{ public static void createTextBitmap(String content, String fontName, int fontSize, int alignment){ + // avoid error when content is "" + if (content.compareTo("") == 0){ + content = " "; + } + Paint paint = newPaint(fontName, fontSize, alignment); TextProperty textProperty = getTextWidthAndHeight(content, paint); diff --git a/tests/test.android/src/org/cocos2dx/lib/Cocos2dxBitmap.java b/tests/test.android/src/org/cocos2dx/lib/Cocos2dxBitmap.java index 5946e8f72b..894b64416c 100644 --- a/tests/test.android/src/org/cocos2dx/lib/Cocos2dxBitmap.java +++ b/tests/test.android/src/org/cocos2dx/lib/Cocos2dxBitmap.java @@ -22,6 +22,11 @@ public class Cocos2dxBitmap{ public static void createTextBitmap(String content, String fontName, int fontSize, int alignment){ + // avoid error when content is "" + if (content.compareTo("") == 0){ + content = " "; + } + Paint paint = newPaint(fontName, fontSize, alignment); TextProperty textProperty = getTextWidthAndHeight(content, paint);