Commit 2e99161
authored
fix(world): size world backgrounds from the camera's extent, not viewport * 5 (#199)
A halo config behaved differently in a slide view and a world view: the same
radius: 0.55 that reads as a half-screen glow became a wash flooding every
frame. HaloZone documents its fields as fractions of width/height; in a world
view they were fractions of a hardcoded 5x viewport.
Two problems in one line. The unit changed silently with the view type, and
5.0 was unrelated to the world's actual extent — a world spanning two
viewports got the same canvas as one spanning ten, so calibrating a halo was
trial and error with no rule to reason from.
WorldTimeline::world_extent derives the surface from the camera's own
waypoints: the union of one viewport-sized rect per waypoint, which is exactly
the span the camera ever shows. The origin travels with it, so negative
world-positions are inside the world rather than off its edge.
HaloZone's doc comments now name the surface for both view types.
Visual change: any world-view halo calibrated against the old 5x canvas covers
a different share of the frame now — proportionally larger for a world smaller
than five screens, which is most of them.1 parent eeed5b0 commit 2e99161
4 files changed
Lines changed: 117 additions & 10 deletions
File tree
- crates
- rustmotion-core/src/schema
- rustmotion/src/engine
- render
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
440 | 442 | | |
441 | 443 | | |
442 | | - | |
| 444 | + | |
443 | 445 | | |
444 | 446 | | |
445 | | - | |
| 447 | + | |
| 448 | + | |
446 | 449 | | |
447 | 450 | | |
448 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
70 | 77 | | |
71 | | - | |
| 78 | + | |
72 | 79 | | |
73 | 80 | | |
74 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
841 | 841 | | |
842 | 842 | | |
843 | 843 | | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
844 | 847 | | |
845 | 848 | | |
846 | 849 | | |
| |||
917 | 920 | | |
918 | 921 | | |
919 | 922 | | |
920 | | - | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
921 | 933 | | |
922 | 934 | | |
923 | 935 | | |
| |||
942 | 954 | | |
943 | 955 | | |
944 | 956 | | |
| 957 | + | |
945 | 958 | | |
946 | 959 | | |
947 | 960 | | |
| |||
953 | 966 | | |
954 | 967 | | |
955 | 968 | | |
| 969 | + | |
956 | 970 | | |
957 | 971 | | |
958 | 972 | | |
| |||
1006 | 1020 | | |
1007 | 1021 | | |
1008 | 1022 | | |
1009 | | - | |
| 1023 | + | |
1010 | 1024 | | |
1011 | 1025 | | |
1012 | 1026 | | |
1013 | 1027 | | |
1014 | 1028 | | |
1015 | | - | |
| 1029 | + | |
1016 | 1030 | | |
1017 | 1031 | | |
1018 | 1032 | | |
| |||
1143 | 1157 | | |
1144 | 1158 | | |
1145 | 1159 | | |
| 1160 | + | |
1146 | 1161 | | |
1147 | 1162 | | |
1148 | 1163 | | |
| |||
1160 | 1175 | | |
1161 | 1176 | | |
1162 | 1177 | | |
1163 | | - | |
| 1178 | + | |
1164 | 1179 | | |
1165 | 1180 | | |
1166 | 1181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
129 | 160 | | |
130 | 161 | | |
131 | 162 | | |
| |||
606 | 637 | | |
607 | 638 | | |
608 | 639 | | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
0 commit comments