-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path[proc,scrollbar_vertical_rebuild].cs2
32 lines (32 loc) · 1.17 KB
/
[proc,scrollbar_vertical_rebuild].cs2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// 231
[proc,scrollbar_vertical_rebuild](component $component0, component $component1)
if (cc_find($component0, 4) = ^true) {
cc_setposition(0, 0, ^setpos_abs_centre, ^setpos_abs_top);
cc_setsize(0, 16, ^setsize_minus, ^setsize_abs);
}
if (cc_find($component0, 5) = ^true) {
cc_setposition(0, 0, ^setpos_abs_centre, ^setpos_abs_bottom);
cc_setsize(0, 16, ^setsize_minus, ^setsize_abs);
}
if (cc_find($component0, 0) = ^true) {
cc_setposition(0, 0, ^setpos_abs_centre, ^setpos_abs_centre);
cc_setsize(0, 32, ^setsize_minus, ^setsize_minus);
}
def_int $int2 = 0;
def_int $int3 = 0;
def_int $int4 = 0;
def_int $height5 = 0;
if (cc_find($component0, 1) = ^true) {
$int3 = ~max(1, if_getheight($component1));
$int2 = ~max($int3, if_getscrollheight($component1));
$int4 = ~max(10, calc(if_getheight($component0) - 32));
$height5 = ~max(10, ~min($int4, scale($int3, $int2, $int4)));
cc_setsize(0, $height5, ^setsize_minus, ^setsize_abs);
if (.cc_find($component0, 2) = ^true) {
.cc_setsize(0, 5, ^setsize_minus, ^setsize_abs);
}
if (.cc_find($component0, 3) = ^true) {
.cc_setsize(0, 5, ^setsize_minus, ^setsize_abs);
}
~scrollbar_vertical_setdragger($component0, $component1);
}