summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael BOUCHAUD <michael.bouchaud@gmail.com>2012-07-09 15:10:34 +0000
committerMichael BOUCHAUD <michael.bouchaud@gmail.com>2012-07-09 15:10:34 +0000
commitd6ed2d7ec8418f2048b7758005e5e686b4ef7b2f (patch)
tree3f05322ef6d448f0a89b6e23572a3332bb086aba
parentcfe72dc5bc3f4a2537da2e9b04f87254f23bbec3 (diff)
ekbd: fix aspect_fixed
SVN revision: 73505
-rw-r--r--src/lib/ekbd_layout.c51
1 files changed, 23 insertions, 28 deletions
diff --git a/src/lib/ekbd_layout.c b/src/lib/ekbd_layout.c
index 8487db6..37a6452 100644
--- a/src/lib/ekbd_layout.c
+++ b/src/lib/ekbd_layout.c
@@ -1132,11 +1132,22 @@ _ekbd_layout_tie_calc(Smart_Data *sd)
1132 1132
1133 rw = sd->w / (double)sd->layout.w; 1133 rw = sd->w / (double)sd->layout.w;
1134 rh = sd->h / (double)sd->layout.h; 1134 rh = sd->h / (double)sd->layout.h;
1135 if (rw < rh) rr = rw; 1135 if (rw < rh)
1136 else rr = rh; 1136 {
1137 rr = rw;
1138 if (sd->aspect_fixed)
1139 rh = rr;
1140 }
1141 else
1142 {
1143 rr = rh;
1144 if (sd->aspect_fixed)
1145 rh = rr;
1146 }
1137 1147
1138 x = (kt->key->x + (kt->key->w / 2)) - ((rw * kt->w) / 2); 1148 x = (kt->key->x + (kt->key->w / 2)) - ((rr * kt->w) / 2);
1139 y = kt->key->y - (rh * kt->h); 1149 y = kt->key->y - (rh * kt->h);
1150
1140 if (y < sd->y) 1151 if (y < sd->y)
1141 { 1152 {
1142 y = kt->key->y + kt->key->h; 1153 y = kt->key->y + kt->key->h;
@@ -1165,32 +1176,16 @@ _ekbd_layout_tie_calc(Smart_Data *sd)
1165 x = x + ex; 1176 x = x + ex;
1166 y = y + ey; 1177 y = y + ey;
1167 1178
1168 if (sd->aspect_fixed) 1179 EINA_LIST_FOREACH(sd->down.tie->keys, l, ky)
1169 { 1180 {
1170 EINA_LIST_FOREACH(sd->down.tie->keys, l, ky) 1181 ky->x = x + (rw * ky->orig_x);
1171 { 1182 ky->y = y + (rh * ky->orig_y);
1172 ky->x = x + (rr * ky->orig_x); 1183 ky->w = ky->orig_w * rw;
1173 ky->y = y + (rr * ky->orig_y); 1184 ky->h = ky->orig_h * rh;
1174 ky->w = ky->orig_w * rr; 1185 edje_object_scale_set(ky->obj, rr);
1175 ky->h = ky->orig_h * rr; 1186 evas_object_move(ky->obj, ky->x, ky->y);
1176 edje_object_scale_set(ky->obj, rr); 1187 evas_object_resize(ky->obj, ky->w, ky->h);
1177 evas_object_move(ky->obj, ky->x, ky->y); 1188 }
1178 evas_object_resize(ky->obj, ky->w, ky->h);
1179 }
1180 }
1181 else
1182 {
1183 EINA_LIST_FOREACH(sd->down.tie->keys, l, ky)
1184 {
1185 ky->x = x + (rw * ky->orig_x);
1186 ky->y = y + (rh * ky->orig_y);
1187 ky->w = ky->orig_w * rw;
1188 ky->h = ky->orig_h * rh;
1189 edje_object_scale_set(ky->obj, rr);
1190 evas_object_move(ky->obj, ky->x, ky->y);
1191 evas_object_resize(ky->obj, ky->w, ky->h);
1192 }
1193 }
1194} 1189}
1195 1190
1196 1191