Skip to content

Fix divide by zero in ui::Slider (#19957) #20019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2019
Merged

Conversation

minggo
Copy link
Contributor

@minggo minggo commented Aug 8, 2019

  • 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.

  • [UISlider.cpp] Divide by 0 error if _maxPercent is equal to 0, which is an allowed value.

* 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.

* [UISlider.cpp] Divide by 0 error if _maxPercent is equal to 0, which is an allowed value.
@minggo minggo added this to the 4.0 milestone Aug 8, 2019
@minggo minggo merged commit b606f2a into cocos2d:v4 Aug 13, 2019
@minggo minggo deleted the syn-19957 branch October 8, 2019 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants