Sfoglia il codice sorgente

Resolution: slightly change the calculation

customisations
alemart 11 mesi fa
parent
commit
47b3adb46f
2 ha cambiato i file con 10 aggiunte e 10 eliminazioni
  1. 6
    6
      docs/api/resolution.md
  2. 4
    4
      src/utils/resolution.ts

+ 6
- 6
docs/api/resolution.md Vedi File

6
 
6
 
7
 | Resolution | 16:9 landscape | 16:10 landscape | 4:3 landscape | Notes |
7
 | Resolution | 16:9 landscape | 16:10 landscape | 4:3 landscape | Notes |
8
 | ---------- | -------------- | --------------- | ------------- | ----- |
8
 | ---------- | -------------- | --------------- | ------------- | ----- |
9
-| `"xs"` | 212x120 | 192x120 | 160x120 | |
10
-| `"xs+"` | 284x160 | 256x160 | 212x160 | |
9
+| `"xs"` | 214x120 | 192x120 | 160x120 | |
10
+| `"xs+"` | 284x160 | 256x160 | 214x160 | |
11
 | `"sm"` | 356x200 | 320x200 | 266x200 | |
11
 | `"sm"` | 356x200 | 320x200 | 266x200 | |
12
-| `"sm+"` | 426x240 | 384x240 | 320x240 | |
12
+| `"sm+"` | 426x240 | 384x240 | 320x240 | 240p |
13
 | `"md"` | 568x320 | 512x320 | 426x320 | |
13
 | `"md"` | 568x320 | 512x320 | 426x320 | |
14
-| `"md+"` | 640x360 | 576x360 | 480x360 | |
15
-| `"lg"` | 852x480 | 768x480 | 640x480 | 480p |
14
+| `"md+"` | 640x360 | 576x360 | 480x360 | 360p |
15
+| `"lg"` | 854x480 | 768x480 | 640x480 | 480p |
16
 | `"lg+"` | 1066x600 | 960x600 | 800x600 | |
16
 | `"lg+"` | 1066x600 | 960x600 | 800x600 | |
17
 | `"xl"` | 1280x720 | 1152x720 | 960x720 | 720p |
17
 | `"xl"` | 1280x720 | 1152x720 | 960x720 | 720p |
18
-| `"xl+"` | 1364x768 | 1228x768 | 1024x768 | |
18
+| `"xl+"` | 1366x768 | 1228x768 | 1024x768 | |
19
 | `"xxl"` | 1600x900 | 1440x900 | 1200x900 | |
19
 | `"xxl"` | 1600x900 | 1440x900 | 1200x900 | |
20
 | `"xxl+"` | 1706x960 | 1536x960 | 1280x960 | 960p |
20
 | `"xxl+"` | 1706x960 | 1536x960 | 1280x960 | 960p |

+ 4
- 4
src/utils/resolution.ts Vedi File

65
     if(aspectRatio >= 1) {
65
     if(aspectRatio >= 1) {
66
         // landscape
66
         // landscape
67
         height = referenceHeight;
67
         height = referenceHeight;
68
-        width = Math.round(height * aspectRatio);
69
-        width -= width % 2;
68
+        width = Math.floor(height * aspectRatio);
69
+        width += width % 2;
70
     }
70
     }
71
     else {
71
     else {
72
         // portrait
72
         // portrait
73
         width = referenceHeight;
73
         width = referenceHeight;
74
-        height = Math.round(width / aspectRatio);
75
-        height -= height % 2;
74
+        height = Math.floor(width / aspectRatio);
75
+        height += height % 2;
76
     }
76
     }
77
 
77
 
78
     return Speedy.Size(width, height);
78
     return Speedy.Size(width, height);

Loading…
Annulla
Salva