Fixed the bug that labels with inner_width/height disappears
authorJi-hoon Lee <dalton.lee@samsung.com>
Fri, 29 Mar 2013 12:17:58 +0000 (21:17 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Fri, 29 Mar 2013 12:19:27 +0000 (21:19 +0900)
packaging/libscl-ui.spec
scl/gwes/efl/sclgraphics-efl.cpp
scl/include/sclversion.h

index ee03551..0ca8d31 100644 (file)
@@ -3,7 +3,7 @@
 
 Name:       libscl-ui
 Summary:    A library for developing XML-based software keyboards
-Version:    0.2.4
+Version:    0.2.5
 Release:    1
 Group:      TO BE / FILLED IN
 License:    TO BE / FILLED IN
index 7c9f885..e8fc094 100644 (file)
@@ -579,6 +579,10 @@ CSCLGraphicsImplEfl::draw_text(sclwindow window, const scldrawctx draw_ctx, cons
 
                 if (text_object) {
                     if (inner_width > 0 || inner_height > 0) {
+                        SclPoint bottom_right;
+                        bottom_right.x = pos_x + width;
+                        bottom_right.y = pos_y + height;
+
                         /* The inner width and height value should be bigger than 0 */
                         if (inner_width <= 0) inner_width = width;
                         if (inner_height <= 0) inner_height = height;
@@ -610,8 +614,19 @@ CSCLGraphicsImplEfl::draw_text(sclwindow window, const scldrawctx draw_ctx, cons
                         } else {
                             pos_y += padding_y;
                         }
-                        width = inner_width;
-                        height = inner_height;
+
+                        /* Make sure the inner bounding box does not exceed the original bounding box */
+                        if (pos_x + inner_width > bottom_right.x) {
+                            width = bottom_right.x - pos_x;
+                        } else {
+                            width = inner_width;
+                        }
+                        if (pos_y + inner_height > bottom_right.y) {
+                            height = bottom_right.y - pos_y;
+                        } else {
+                            height = inner_height;
+                        }
+
                         align = LABEL_ALIGN_CENTER_MIDDLE;
                         padding_x = 0;
                         padding_y = 0;
index 0b99318..a64e042 100644 (file)
@@ -18,7 +18,7 @@
 #ifndef __SCL_VERSION_H__
 #define __SCL_VERSION_H__
 
-#define SCL_VERSION "0.2.4-1"
+#define SCL_VERSION "0.2.5-1"
 
 #endif //__SCL_VERSION_H