Skip to content

Commit dc428de

Browse files
author
AZhurav1ev
committed
Added new enjoyHint vertical space calculating conditions for small devices
1 parent 788a60a commit dc428de

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

enjoyhint.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,8 +1220,8 @@
12201220
var left_offset = data.center_x - half_w;
12211221
var right_offset = body_size.w - (data.center_x + half_w);
12221222

1223-
var label_shift = 150;
1224-
var label_margin = 40;
1223+
var label_shift = window.innerHeight < 670 ? 130 : 150;
1224+
var label_margin = window.innerHeight < 670 ? 0 : 40;
12251225
var label_shift_with_label_height =
12261226
label_shift + label_height + label_margin;
12271227
var label_ver_offset = half_h + label_shift;
@@ -1237,7 +1237,7 @@
12371237
{name: 'center_bottom', common_area: window.innerWidth * bottom_offset, width: window.innerWidth, height: bottom_offset},
12381238
];
12391239
var label_horizontal_space_required = label_width;
1240-
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;
12411241

12421242
var areas_priority = areas_for_label
12431243
.sort(function(area1, area2){return area1.common_area - area2.common_area})

0 commit comments

Comments
 (0)