Commit 651acd0
Fix ui::Layout scissor clipping (#20352)
* Added RenderTexture::saveToFileAsNonPMA() to save images without PMA.
Set the PMA parameter to true when calling initWithRawData() inside RenderTexture::newImage(), since textures are PMA.
Renamed Image::premultipliedAlpha() to Image::premultiplyAlpha() to better reflect it's action, and made it public.
Added Image::reversePremultipliedAlpha() to allow the reversing of the PMA.
Updated CCImage-ios.mm to set the correct bitmapInfo for PMA and non-PMA images before saving a file.
Updated RenderTextureTest::RenderTextureSave() to cater for non-PMA file saving.
* [CCImage-ios.mm] Fixed indentation.
* [UILayout.cpp] Fix for incorrect SCISSOR clipping rectangle calculation.
[UILayoutTest.cpp] Test added to reproduce issue with SCISSOR clipping.
* Get reference to clipping rectangle instead of a copy.1 parent 8708e82 commit 651acd0
File tree
3 files changed
+81
-14
lines changed- cocos/ui
- tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest
3 files changed
+81
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
471 | 470 | | |
472 | 471 | | |
473 | 472 | | |
| |||
485 | 484 | | |
486 | 485 | | |
487 | 486 | | |
488 | | - | |
489 | | - | |
490 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
491 | 490 | | |
492 | 491 | | |
493 | 492 | | |
494 | | - | |
| 493 | + | |
495 | 494 | | |
496 | 495 | | |
497 | 496 | | |
498 | 497 | | |
499 | 498 | | |
500 | | - | |
| 499 | + | |
501 | 500 | | |
502 | 501 | | |
503 | 502 | | |
504 | 503 | | |
505 | | - | |
| 504 | + | |
506 | 505 | | |
507 | 506 | | |
508 | 507 | | |
509 | 508 | | |
510 | | - | |
| 509 | + | |
511 | 510 | | |
512 | 511 | | |
513 | 512 | | |
| |||
528 | 527 | | |
529 | 528 | | |
530 | 529 | | |
531 | | - | |
532 | | - | |
| 530 | + | |
| 531 | + | |
533 | 532 | | |
534 | 533 | | |
535 | 534 | | |
| |||
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
956 | 957 | | |
957 | 958 | | |
958 | 959 | | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
165 | 173 | | |
0 commit comments