|
281 | 281 | scroll: step_data.scroll
|
282 | 282 | };
|
283 | 283 |
|
| 284 | + if (shape_data.center_x === 0 && shape_data.center_y === 0) { |
| 285 | + $body.enjoyhint("hide"); |
| 286 | + destroyEnjoy(); |
| 287 | + return console.log("Error: Element position couldn't be reached"); |
| 288 | + } |
| 289 | + |
284 | 290 | if (step_data.shape && step_data.shape == "circle") {
|
285 | 291 | shape_data.shape = "circle";
|
286 | 292 | shape_data.radius = radius;
|
|
379 | 385 | case "skip":
|
380 | 386 | skipAll();
|
381 | 387 | break;
|
| 388 | + |
| 389 | + default: $body.trigger(makeEventName(event_name, true)); |
382 | 390 | }
|
383 | 391 | };
|
384 | 392 |
|
|
1212 | 1220 | var left_offset = data.center_x - half_w;
|
1213 | 1221 | var right_offset = body_size.w - (data.center_x + half_w);
|
1214 | 1222 |
|
1215 |
| - var label_shift = 150; |
1216 |
| - var label_margin = 40; |
| 1223 | + var label_shift = window.innerHeight < 670 ? 130 : 150; |
| 1224 | + var label_margin = window.innerHeight < 670 ? 0 : 40; |
1217 | 1225 | var label_shift_with_label_height =
|
1218 | 1226 | label_shift + label_height + label_margin;
|
1219 | 1227 | var label_ver_offset = half_h + label_shift;
|
|
1229 | 1237 | {name: 'center_bottom', common_area: window.innerWidth * bottom_offset, width: window.innerWidth, height: bottom_offset},
|
1230 | 1238 | ];
|
1231 | 1239 | var label_horizontal_space_required = label_width;
|
1232 |
| - var label_vertical_space_required = label_shift_with_label_height + 20; |
| 1240 | + var label_vertical_space_required = window.innerHeight <= 670 ? label_shift_with_label_height : label_shift_with_label_height + 20; |
1233 | 1241 |
|
1234 | 1242 | var areas_priority = areas_for_label
|
1235 | 1243 | .sort(function(area1, area2){return area1.common_area - area2.common_area})
|
|
1246 | 1254 | }
|
1247 | 1255 | }
|
1248 | 1256 |
|
1249 |
| - var data_width_size = data.width ? data.width : data.radius * 2; |
1250 |
| - var data_height_size = data.height ? data.height : data.radius * 2; |
| 1257 | + var data_width_size = data.shape === "circle" ? data.radius * 2 : |
| 1258 | + data.width ? data.width : data.radius * 2; |
| 1259 | + |
| 1260 | + var data_height_size = data.shape === "circle" ? data.radius * 2 : |
| 1261 | + data.height ? data.height : data.radius * 2; |
1251 | 1262 |
|
1252 | 1263 | var right_position = data.center_x + data_width_size/2 + 80;
|
1253 | 1264 | var left_position = data.center_x - label_width - data_width_size/2 - 80;
|
|
0 commit comments